Add a timeout event.wait_for() method.

Not exactly like std::condition_variable, but similar.
Merge pull request #49 from unknownbrackets/event-timeout

Add a timeout event.wait_for() method