[demangler] Fix an oss-fuzz bug from r338138

Stack overflow on invalid. While collapsing references, we were skipping over a
cycle check in ForwardTemplateReference leading to a stack overflow. This commit
fixes the problem by duplicating the cycle check in ReferenceType.

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@338190 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed