darwin: assume CFRunLoopStop() isn't thread-safe

Use signaling mechanism for loop termination, because CFRunLoopStop() is
most likely not a thread-safe function and invoking it from other thread
may sometimes result in a "dead-lock".

fix #799

/cc @bnoordhuis