Add a debugging option called DEBUG_REFCOUNT_RUNLOOP.

You cannot use the runloop here from more than one thread at a time.
If you do, you will crash inside wait_runloop.  This mistake is easy
to make though, and very hard to debug because the race window inside
wait_runloop is small.

This #define adds a reference count to make it easier to catch this
problem.  It doesn't make the race window any wider, but if you hit
it you get a hard failure instead of dereferencing an invalid pointer.