Better TCP close handling