history, etc: add workarounds for all tracebacks reported in #969
Sadly, there were only a few actual places that needed workarounds. I should have done this early on in 1.0. Though perhaps with these leaks plugged users will find new ones.
Interestingly, I noticed the easiest way to reproduce the parents() problem was to simply 'hg qref' from the command line. You wouldn't think this would be a big deal, but it does change the hash of the top patch.