process: fix the case where PerProcessorScheduler::sleep() would put a thread to sleep when an event was pending, causing the event to be ignored until another event fired or the thread was woken.
process: added the concept of an 'idle' thread to PerProcessorScheduler, which is executed if no other threads are available.

Previously, the 'idle' thread was merely just a thread with the lowest
possible priority. By making the idle thread a separate construct, we now
ensure that it doesn't get run while the rest of the system is under load.