Reconnect on socket closed

When sending logs to Redis instances behind a loadbalancer, sometimes it closes the socket when balancing the connections. This small patch does a reconnect on such an event.