Fixed atomic operations when preemption is enabled.
pthread_mutex_lock()/pthread_mutex_unlock()/pthread_cond_wait()/pthread_cond_signal() was failing.
This fixes playing videos in ffplay (it can play the videos now without stopping).