fixed bug in code example of lock()

The code example in the comment of lock() didn't work. Without the 'break' the loop goes on and on and tries again to lock the key which will fail with TemporaryFailError.