Sanitize the filename used to store test errors in output_save.py

When a test case fails and is named with invalid characters ('<' for example), output_save.py fails to write the test failure because the file name is invalid.

Also in this change: use correct name if error occurs in setup/teardown (related to #7).