Check if port is available before test start and after test stop

I have a theory that a Windows run was testing the wrong server, so
this change should report problems like this by checking to see if
the port is available before starting the test and after stopping
the test.

Note that if you pull this PR, you should do a run soon after to find any problems with it, since a problem in a change like this could ruin/waste the whole run.