Fix memleak, free TreeBuilder

(*Repository).TreeBuilder() didn't freed C resource, which caused memleak.