bakcontent-do: improve handling of git errors
bakcontent-do: only the subprocesses should chdir to rootdir
bakcontent-do: clean up old history files for deleted files and dirs

Since we started doing 'git rm --cached' on the history files (to allow
reuse of existing sha512), we have to explicitly find and remove old
orphan history files.
bakcontent-do-files: avoid rewriting meta files if it exists and is identical