This ensures that if we emit the same diagnostic twice, the error count will match the real number of errors shown to the user. Fixes #42106
Renames only in this commit, and obviously .stderr file additions.