fix lock deadlock issue if OnLockAcquired throws

This is related to this https://github.com/projectkudu/kudu/issues/1263 issue.