Close TCPServer after port is found