TcpLink: fixed exception around closed socket