Concurrency: support draining the main queue in single threaded mode
Concurrency: support draining the main queue in single threaded mode

When built in single threaded mode, the runtime does not use dispatch to
queue the tasks.  As a result, pumping the dispatch main queue will
simply wait indefinitely.  In the single threaded mode, simply halt
execution and drain all pending tasks before returning.  This allows
forward progress in the single threaded mode.

benlangmuir/swift,rudkx/swift,apple/swift,atrick/swift,atrick/swift,gregomni/swift,atrick/swift,benlangmuir/swift,xwu/swift,gregomni/swift,rudkx/swift,xwu/swift,tkremenek/swift,ahoppen/swift,roambotics/swift,xwu/swift,parkera/swift,rudkx/swift,parkera/swift,JGiola/swift,benlangmuir/swift,xwu/swift,parkera/swift,ahoppen/swift,xwu/swift,xwu/swift,glessard/swift,JGiola/swift,apple/swift,roambotics/swift,roambotics/swift,tkremenek/swift,parkera/swift,atrick/swift,hooman/swift,tkremenek/swift,JGiola/swift,ahoppen/swift,hooman/swift,tkremenek/swift,parkera/swift,JGiola/swift,ahoppen/swift,gregomni/swift,xwu/swift,JGiola/swift,apple/swift,tkremenek/swift,atrick/swift,roambotics/swift,benlangmuir/swift,parkera/swift,gregomni/swift,benlangmuir/swift,roambotics/swift,gregomni/swift,apple/swift,rudkx/swift,tkremenek/swift,apple/swift,tkremenek/swift,ahoppen/swift,benlangmuir/swift,gregomni/swift,hooman/swift,glessard/swift,glessard/swift,apple/swift,glessard/swift,rudkx/swift,hooman/swift,parkera/swift,glessard/swift,JGiola/swift,parkera/swift,hooman/swift,ahoppen/swift,rudkx/swift,hooman/swift,hooman/swift,atrick/swift,glessard/swift,roambotics/swift