[DependencyInjection] use/fix newest Definition::setFactory

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -
Why should I not? This was precisely what I was trying to do to make https://github.com/symfony/symfony/pull/13087/files#diff-c2459e2c1a786adcaaab00b70630b67fR24 work