Fixes case where iterators are running while the transaction has been closed