Add a timeout event.wait_for() method

Not exactly like std::condition_variable, but similar.  Adding this to add a proper event for Core shutdown in PPSSPP.

Seems to work on Windows and Linux, but let me know if I used `pthread_cond_timedwait()` incorrectly.

-[Unknown]