Ensure #stop is called if #shutdown fails in test