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>
This line: https://github.com/opscode/ohai/pull/439/files#diff-75a73220c9d871c32e28267a40f27b1fR25