if a test fails or exits with an error, run cleanup as a precaution