If we exit early (e.g. checking the triggers) repack_cleanup() is not called but we must close the transactions anyway.