Wait for server to have stopped in tests
Wait for server to have stopped in tests

I think this is the issue I was seeing on Travis: it complained about a
resource (the socket) being busy, which means one test was started while
another one was still running a server. Alhough the server was stopped
by killing the thread, it takes time for the server to stop, so the test
should wait for the thread to exit after killing it.

ruuda/hoff,ruuda/hoff