Refactor Java NIO::Selector again, and fix a timeout bug
Refactor Java NIO::Selector again, and fix a timeout bug

This change completely reimplements #select in terms of #select_each,
removing duplication. The factored out "run_select" method from before
is no longer needed.

I also discovered an oddity about Java NIO's API semantics: if you pass
a timeout of 0 it assumes you want to block forever. wat?

Now instead if a zero timeout is passed it uses the selectNow() method
to do a non-blocking select.

celluloid/nio4r,frsyuki/nio4r,frsyuki/nio4r,celluloid/nio4r,celluloid/nio4r,frsyuki/nio4r,tpetchel/nio4r,marshall-lee/nio4r,marshall-lee/nio4r,marshall-lee/nio4r,tpetchel/nio4r,tpetchel/nio4r