Keep track of delete calls and delete them at the end

This allows the pass to finish properly.