Otherwise a system failure might leave a broken repo. Note that these
changes may not be comprehensive, but they're a start, and hopefully
deal with some of the most critical data.
In addition to syncing the pack data itself, sync the parent directory
after the final rename so that we don't risk losing the reference to
the new file.