tgrep.py: break _treepositions_no_leaves out of tgrep_positions