Fix memory leak in Repository_head__set__
Fix memory leak in TreeBuilder_get