Fix spurrious issue with same name twice in branch name.

Code that was specific to TBranchSTL was applied to all
branches leading to spurrious removal of part of the branch
name if the same data member name was repeated twice in
the hierarchy.   This fixes ROOT-5628.

(cherry picked from master branch
 commit 3c56446182ba2e2450fa288efe57b4f892dc298b)