write.c: ensure that 'old_integrity_table' is always freed