Added a cEvent::Wait() with timeout.

This will let us write task threads.