Instead of using sleeps, have the inferior notify us (via a signal) that
the requested number of threads have been created.
This allows us to get rid of some fairly dodgy test utility code --
wait_for_thread_count seemed like it was waiting for the threads to
appear, but it never actually let the inferior run, so it only succeeded
if the threads were already started when the function was called. Since
the function was called after a fairly small delay (1s, usually), this
is probably the reason why the tests were failing on some bots.
I don't think this is an issue but what would cause you to have > the number of threads?
Are there automatically created threads sometimes that we don't explicitly ask for.