[ty] Avoid caching specialization-invariant known instances (#25816)
## Summary
`apply_specialization` already handles atomic types before entering its
tracked query, but several `KnownInstanceType` variants still create and
retain query entries even though specialization always returns the
original type.
This handles those specialization-invariant known instances directly.
Variants that can depend on type variables continue through the existing
tracked implementation.