Fix diverting stdout not working more than once
Stop the server before destroying the test databases