Partially fixing test to release lock in finally block.