chutney should cope better when sockets are closed

At the moment, it just re-tries the connection after a few seconds, then gives up after a few tries. We should be smarter than that.