QCamera2/HAL3: correct mutex lock/unlock sequence

Bug: 36716469
CRs-Fixed: 2053027
Change-Id: I6699c3682eec419fb6efb0583e9909e5739476a0
(cherry picked from commit a5eedde871c8e87784014e541c4aec247e954dc2)
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 75a82ab..77befdc 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -1837,6 +1837,7 @@
                 newStream->max_buffers = MAX_INFLIGHT_REPROCESS_REQUESTS;
             } else {
                 ALOGE("%s: Error, Unknown stream type", __func__);
+                pthread_mutex_unlock(&mMutex);
                 return -EINVAL;
             }
 
@@ -3595,6 +3596,7 @@
             if(ADD_SET_PARAM_ENTRY_TO_BATCH(mParameters,
                 CAM_INTF_META_FRAME_NUMBER, request->frame_number)) {
                 ALOGE("%s: Failed to set the frame number in the parameters", __func__);
+                pthread_mutex_unlock(&mMutex);
                 return BAD_VALUE;
             }
         }