Fix Issue 13478 - [REG2.066] Templates not emitted when also referenced in speculative contexts

On master, this has already been fixed as a by-product of
Kenji's minst/… rewrite of the instantiation tracking logic.