Implement undo support for name operations.

Record changes made to the name database in the block undo data, so that
we can correctly disconnect blocks again.