Make Mutex#sleep spec a bit less racy.

The sleep spec attempts to spin the spec thread until the Mutex
thread has both locked and slept by checking thread status ==
"sleep". However, part of the behavior of Mutex#lock is that if
it has to block it must go into "sleep" status. On most impls, it
is not possible to set thread status to "sleep" and attempt to
lock atomically, so there's always a gap between the two. This
makes the spec racy, since it might see "sleep" during the attempt
to lock, and as a result fail the subsequent check for
Mutex#locked? because the lock has not occurred.

This change introduces a local variable "locked" that will be set
to true once we know the locking has completed. The spec now
waits first for that locked variable to go true, and then proceeds
to check wait for the thread to sleep. This should at least avoid
the lack of atomicity in thread status + Mutex#lock from causing
this spec to fail sporadically.