QCamera2/HAL3: correct mutex lock/unlock sequence

Bug: 36716469
CRs-Fixed: 2053027
Change-Id: I6699c3682eec419fb6efb0583e9909e5739476a0
(cherry picked from commit a5eedde871c8e87784014e541c4aec247e954dc2)
(cherry picked from commit e3620d0413f050f84012ff1ff5c14a8455c2b58e)
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index f94d211..5f9f974 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -1892,6 +1892,7 @@
                 newStream->max_buffers = MAX_INFLIGHT_REPROCESS_REQUESTS;
             } else {
                 ALOGE("%s: Error, Unknown stream type", __func__);
+                pthread_mutex_unlock(&mMutex);
                 return -EINVAL;
             }
 
@@ -3701,6 +3702,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;
             }
         }