Release lock on exception