Fixed #225

Now shutdown_test_server waits for app_running? to return false or throws an exception otherwise.