[Refactoring] Small cleanup for Expression::checkPurity
Remove code for bug 7107 and 10296 because they are unnecessary anymore.

Now instantiated symbols can reach correct "parent" via `Dsymbol::toParent2()`, because `TemplateInstance::enclosing` is properly calculated in `TemplateInstance::hasNestedArgs`.
fix Issue 12704 - typeof function literal incorrectly infers attributes
Merge pull request #3530 from 9rnsr/fix12704

Issue 12704 - typeof function literal incorrectly infers attributes
Fix Issue 12705 and Fixup Pull 3501 - Default trust implies @system, and typeof(func) should
extract proper function attributes.
Merge pull request #3533 from AndrejMitrovic/FixupAttribs

Fix Issue 12705 and Fixup Pull 3501 - Fix @system and missing attributes when typeof(func) is used