fix Issue 13333 - Incorrect error ungagging during the resolution of forward references

Improve forward reference resolution in template instantiation with alias

- Check needGagging in TemplateInstance::semantic2()
- Set TemplateInstance::speculative if global.gag is set in semantic()
Check unsafe variable declaring is unnecessary for function local aggregate members

It would cause unresolved forward reference because `TypeStruct::hasPointers()` requires the complete types of the fields.
Improve diagnostic in recursive template expansion
[Refactoring] bool speculative
[Refactoring] Remove global.speculativeGagging()

By the improvement of recursive aliasing, we can simplify the concept to:
"A template instantiation during errors gagged is 'speculative instantiation'".
Merge pull request #3878 from 9rnsr/fix13333

Issue 13333 - Incorrect error ungagging during the resolution of forward references