mm-video-v4l2: Avoid memory leak due to loss of fd

In case of dynamic buffer mode when FTB proxy is called
reference to the fd is added to the list. However
when qbuf to driver fails during HW overload ,fd's
which were added in the list were not removed and
resulting in to a leak.

Remove the fd reference when qbuf to the driver fails.

Change-Id: I11a960091af1a2f29b8bc0c933a414455db7ff70
CRs-Fixed: 1051720
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index 3086da4..5258cdc 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -6816,6 +6816,10 @@
     if (rc) {
         /*TODO: How to handle this case */
         DEBUG_PRINT_ERROR("Failed to qbuf to driver");
+        if (dynamic_buf_mode) {
+            buf_ref_remove(drv_ctx.ptr_outputbuffer[nPortIndex].pmem_fd,
+                    drv_ctx.ptr_outputbuffer[nPortIndex].offset);
+        }
         buffer->nFilledLen = 0;
         post_event ((unsigned long)buffer, (unsigned long)VDEC_S_SUCCESS, OMX_COMPONENT_GENERATE_FBD);
     }