Add a helper class to assign a random port for a test.