Fix #81: Fix race condition in checking for locked lock in test.