Wait for the reactor to be clean in test teardown

This should solve the random "dirty reactor" test failures we're seeing.