fix lock deadlock issue if OnLockAcquired throws