Add unbind with OCC inactive case for OCC active signal handler

In the event that the application never receives the active signal even
though the OCC is active, the application needs to be able to unbind the
device when the OCC inactive signal is received.

Change-Id: Ib18e00976181cd087491e00abe0a3776c4c3bbb8
Signed-off-by: Eddie James <eajames@linux.ibm.com>
diff --git a/occ_status.cpp b/occ_status.cpp
index 0782f87..407b0ce 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -62,6 +62,17 @@
         // Add error watch again
         addErrorWatch();
     }
+    else if (!value && device.bound())
+    {
+        removeErrorWatch();
+
+        // In the event that the application never receives the active signal
+        // even though the OCC is active (this can occur if the BMC is rebooted
+        // with the host on, since the initial OCC driver probe will discover
+        // the OCCs), this application needs to be able to unbind the device
+        // when we get the OCC inactive signal.
+        device.unBind();
+    }
     return Base::Status::occActive(value);
 }