Fix Repository::Add to write index changes to disk

Without this, changes are not visible outside of the node process,
and seem to be lost. This makes the changes persistent.