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>
Yeah, i can see how the grouping makes sense, but for reading the code i think you require extra of the reader who is trying to read that section.  

```
  rescue SystemCallError
     raise
  rescue SocketError => e
     raise unless e.to_s =~ /getaddrinfo/
```

If I'm trying to figure out if SystemCallError is always raised, I have to parse the conditional rather than just have it being real obvious from the code.