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.
Merge pull request #552 from MalcolmEvershed/check-port-available

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