Cherry-picked merge of D-Programming-Language/druntime#718 from 2.066:
Fix for issue 11981 - deadlock during thread initialization on Posix