[FrameworkBundle] Determine templating.engine.php scope as late as possible

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11653
| License       | MIT
| Doc PR        | -
Hm ok. I never did that before, and I just try anonymous definition, and actually, a reference is created.