refactor tcp close, fix mitmproxy/mitmproxy#376