Fixing corrupted locking state in case where unlock DB call fails.