nanohub: hostIntf: handle memory allocation failures

The memory allocations in hostIntf are quite big, and prone to failing
if there isn't enough available space. Make sure to handle failures, and
print an error, so we know what's happening.

Change-Id: Iddf014f1fb2889a358890c2308e6c0e93b59bf4e
diff --git a/firmware/os/core/hostIntf.c b/firmware/os/core/hostIntf.c
index ccd571d..c1d3cd0 100644
--- a/firmware/os/core/hostIntf.c
+++ b/firmware/os/core/hostIntf.c
@@ -739,7 +739,18 @@
     }
 
     mOutputQ = simpleQueueAlloc(totalBlocks, sizeof(struct HostIntfDataBuffer), queueDiscard);
+    if (!mOutputQ) {
+        osLog(LOG_ERROR, "initSensors: failed to allocate data buffer queue!\n");
+        return false;
+    }
+
     mActiveSensorTable = heapAlloc(numSensors * sizeof(struct ActiveSensor));
+    if (!mActiveSensorTable) {
+        osLog(LOG_ERROR, "initSensors: failed to allocate active sensor table!\n");
+        simpleQueueDestroy(mOutputQ);
+        return false;
+    }
+
     memset(mActiveSensorTable, 0x00, numSensors * sizeof(struct ActiveSensor));
 
     for (i = SENS_TYPE_INVALID; i < SENS_TYPE_LAST_USER; i++) {