Fix racy-git handling in git-write-tree.