a more deterministic Lock test? fixes #82

The doctest for the global lock was sometimes failing because the print
statements from different threads were not atomic. Since the goal of
those tests is to check whether those print statments interleave and not
whether they are atomic, I have added a small delay to the second thread
in order to ensure that they do not occur at the same time.