msm: vidc: Unlock core lock in error case

Unlock core lock in error case to avoid hang issue.

Change-Id: Ia4ae36357bb02aaca4b4933cd97bb8e8f478d2b3
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
msm: vidc: Validate buffer prior to releasing reference

The buffer provided by the firmware could be invalid if we internally
freed it as part of error handling.  As such, before we touch the
buffer, confirm that the buffer is valid.

CRs-Fixed: 726818
Change-Id: I03f8b478bfa42607e1e6887ba16c1c330c37008c
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>