bugfix: the timeout passed to iomux_loop() and iomux_run() can be NULL

so in the select-based implementation of iomux_run() we should ensure we have
a timeout before dereferencing it, otherwise NULL can be passed to select()
to block until an event occurs.

But in iomux_loop() we can't pass NULL to iomux_run() because in the select-based
implementation timers are run after select() has returned, so if no events occur
on a managed filedescriptor no event would fire.