Another shot at TCP CLOSE_WAIT issue, and tiny code tweak