Fix memory corruption causing tree entry modes to be displayed incorrectly

When adding a tree entries for a subdirectory, the directory name is
stripped from the path using memmove(). The length argument for this
operation was calculated assuming a fixed offset of the tree path in the
output from git-ls-tree. However, to display blob sizes -l is passed to
git-ls-tree which changed the offset of the tree path. As a result, the
mode of the next entry in the IO buffer would get corrupted.