Added a couple of additional test cases (covering what happens if the lock method throws an exception).