Ensure circular references do not recurse indefinitely

- Also, update reload_code_object to display the wrapped class rather
  than the original class.  This yields better reload messages without
  breaking existing functionality
- Update tests to use block form of mktmpdir to ensure each tmp file
  gets cleaned up appropriately.