Locking was not quite right here in a certain case where the transaction leaves after other references
were removed. Will restore this optimization in the future with more time to analyze.
This reverts commit ee524f497d0692a2c0c6ea39bd3840183a00f3ed.