Mutex cond_wait not working

Add mutex for cond_wait, or don't work correctly. At least on my build, can't step in the game code.