Factor test-server spawn/teardown code into a single helper function

We seem to have duplicate logic in a lot of integration tests for starting/stopping various servers.  This should be refactored out into a single helper function.