Fix #682: sanitize TestCase objects before they are possibly sent back to the parent process (in the event of a test failure)