Fixed bug where it would not release a lock if the weird interrupt
scenario occurred.