Always unlock the lock

If block() throws an exception that is caught by the caller, then the
previous behavior would not unlock the lock, leading to potential
deadlock.