Fix Transaction destructor bugs. Add concurrency tests.