protect against broken repr in lib.pretty
test bad repr
be really super ultra safe about reprs

don't trust exception strings or class attributes.

adds _safe_getattr, used in a few higher level places to protect against bad objects
test really bad repr
Merge pull request #4459 from minrk/bad-repr

protect against broken repr in lib.pretty