[AST] Fix an assertion failure in TypeName::getFullyQualifiedName (#159312)
This popped up during our internal integrates of upstream changes. It
started happening after ba9d1c41c41d568a798e0a8c38a89d294647c28d, which
started using `TemplateSpecializationType` in this place and the code
was not prepared to handle it.