Linux: avoid zombie process when dispatch_main is called
Linux: avoid zombie process when dispatch_main is called

If the main thread calls pthread_exit on Linux, the process
becomes a zombie. Modify dispatch_main to avoid this by adding
a pthread_key destructor that calls dispatch_sig_thread
(effectively stalling pthread exit until the program really exits).

This patch relies on the TSD destructors being called in order of
creation, which is currently the case in glibc.

apple/swift-corelibs-libdispatch,frankeh/swift-corelibs-libdispatch,frankeh/swift-corelibs-libdispatch,frankeh/swift-corelibs-libdispatch,frankeh/swift-corelibs-libdispatch,apple/swift-corelibs-libdispatch,apple/swift-corelibs-libdispatch,apple/swift-corelibs-libdispatch