Many existing libdispatch tests use CFRunLoop{Run,Stop} to setup the
test harness. Unfortunately, libdispatch only offers dispatch_main
which has no built-in functionality for stopping the run loop.
To emulate the Foundation behavior we schedule an "exit block" to the
main queue that exists when a flag is set. If the flag hasn't been set
yet, the block resubmits itself to to the queue.
I included one adapted example test to show how this would be used.
Let me know if you think this is a good approach and if it sufficiently retains
the original test semantics.
Can we keep the print in main?