[RecursiveASTVisitor] Assert we skip implicit instantiations. (#110899)
In DEF_TRAVERSE_TMPL_SPEC_DECL, we attempt to skip implicit
instantiations by detecting that D->getTemplateArgsAsWritten() returns
nullptr. Previously, this was not reliable. To ensure we do not regress,
add an assertion and a test.