Move transaction cleanup to descructor

Support for connection pooling, since we'll recover the conn after a
task failure.