Rescue and ignore Errno::EBADF from IO.select

It's raised when a socket is closed while the reactor is in IO.select, so it will be cleared up on the next tick.
Rescue and ignore IOError from IO.select

Same rationale as for Errno::EBADF
Merge branch 'handle_badf_in_select'