treebuilder: insert sorted

By inserting in the right position, we can keep the vector sorted,
making entry insertion almost twice as fast.
Merge pull request #2416 from libgit2/cmn/treebuilder-insert-sorted

treebuilder: insert sorted