Corrected tree entry sorting.
Core GIT sorts subtrees into their parent tree as though their names
end in '/', as this is how they are sorted within the index file.
Unfortunately jgit didn't sort like this, which meant it was unable
to read some trees as it would determine the tree was misorted, or
it would write corrupt trees.
This change maintains the tree in memory sorted by name without the
trailing '/'. Therefore the tree is resorted upon loading it into
memory or just before writing it out as a loose object.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>