Fix reconnect after TCP peer has closed socket