irnetbox: Timeout the TCP connection attempt after 10 seconds.

I'd like to use IRNetBox to determine whether the irnetbox has frozen or
not. Usually attempting to set up a TCP socket to a dead irnetbox will
raise a "Connection refused" socket exception. However, I've also seen
times when the TCP socket connection attempt completely hangs.

This commit adds a 10 second timeout _to the socket connection attempt
only_. I do not want to keep the timeout applied because this would
change how the script behave later on; it seems to rely on blocking
reads from the socket.

[Committer's note: "Connection refused" from the irNetBox doesn't mean
that it's dead; the irNetBox only allows one client connection at a
time, so it means that another client is connected to the irNetBox.
Possibly a misbehaving client that hasn't released its connection, but
it could also be a client legitimately sending messages to the irNetBox.

The correct solution† will be to put a proxy server between the irNetBox
and the clients, that *does* handle multiple client connections.

† The solution for the "one client at a time" problem; I don't know what
is causing the "socket connection attempt hangs" problem seen by the
author.]