closing TCP channel on unexpected errors