rb_io_wait_writable should actually wait for writable fd's

This was calling select() with a readable fd set, but of course it needs
to use a writable fd set.

Fixes #2251