Fix a memory leak.

clang-tidy complained that there are cases where `cmd` wouldn't be freed
in this function (specifically if allocation of `cmd` succeeded, and
`!mSensorState[handle].sensorType`).

Moving the free to the end of the function fixes this issue.

Bug: None.
Test: Still builds.
Change-Id: Id89c7fcd4d1e54e45e2427f81dde6bb1c6f0975b
diff --git a/sensorhal/hubconnection.cpp b/sensorhal/hubconnection.cpp
index 538f500..8d9102b 100644
--- a/sensorhal/hubconnection.cpp
+++ b/sensorhal/hubconnection.cpp
@@ -1106,10 +1106,10 @@
         else
             ALOGE("queueData: failed to send command: sensor=%d, length=%zu",
                     cmd->sensorType, length);
-        free(cmd);
     } else {
         ALOGI("queueData: unhandled handle=%d", handle);
     }
+    free(cmd);
 }
 
 void HubConnection::queueData(int handle, void *data, size_t length)