Fix for issue 11981

Issue 11981: deadlock during thread initialization on Posix