[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        | -
Nice,I just try `$container->register('foo', 'stdClass')->addArgument(new Definition('stdClass'));` in a real project and it works. I never did that before ;)