Fix method lock release upon exception

Method lock was not released if method execution was ended
with uncaught exception. As a result dead lock could occur.
This commit moves lock release code into finally block

Change-Id: Ie5794c55c9d5a30cd3255ac06e9af944eb732bb1
Closes-Bug: #1392102
Merge "Fix method lock release upon exception"