TcpClient: fixed the socket close issue