Avoid copying undo data

Seems all undo data was being copied twice in memory before writing to disk.