Dynamically allocates the port for the pyrepl browser test, so that multiple tests can run at the same time. Also allows the pyrepl test to honor the CROSS_BUILD_DIR environment variable.