the mutex that the waiters are using to synchronise, then transfer them
to the mutex's waiters list so that the wakeup is deferred until release
of the mutex. Improves the timings for CV sleep/wakeup by between 30-100%
in tests conducted locally on a UP system. There can be a penalty for MP
systems when only one thread is being awoken, but in practice I think it
won't be be an issue.
- pthread_signal: search for a thread that does not have a pending wakeup.
Threads can have a pending wakeup and still be on the waiters list if we
clash with an earlier pthread_cond_broadcast().