This should speed up registerFreeTcpPort.