transactions: avoid late tear-down (issue641)
We use weak references (ugh) to avoid having to manually delete
transaction references out of each call frame when an exception occurs.
To run the tests, do:
cd tests/
python run-tests.py
See http://www.selenic.com/mercurial/wiki/index.cgi/WritingTests for
more information on writing tests.