Fix connection detection logic.

The fact that we have socket back from IO::select, does not necessarily
mean that mean that we can actually ready and/or write to it.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Also, WTF is TCPSocket doing reverse lookups for by default?  That'll break half the planet that doesn't have their reverse DNS configured correctly, is that something that the ruby authors are actually forcing us to turn off?