Stricter mutex protection, fix stdio errors and compiler warnings

The compiler errors you emailed should be fixed, although I wasn't seeing them here.
This commit also picks up stricter mutex protection I've added.  The volatile keyword doesn't ensure thread safety.  This calls pthread_cond_wait directly because the mutex is already locked and it seemed clumsy to unlock it before calling deadbeef->cond_wait().