wevent: Scaffolding for idle events

Adds a new W_EVENT_IDLE event type, which allows to add callbacks to the
event loop which will be called at periodic intervals whenever no other
events are pending to handle.