Fixes #909 - Move the exception on lock acquisition failure from checkout to outside of the try-catch block so that subsequent threads do not clear the lock set by the first thread