Moving unreferenced deletions out of transactions and test for it