Fixed a couple of race conditions in the wine_pthread routines at
thread startup and exit.

7 files changed