Wait until a TCP server is listening on the given port.