[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        | -
getFactoryMethod is also [used below](https://github.com/symfony/symfony/pull/13087/files#diff-a10c9afd8feaccd1ff66ffd54e2835bcR953) so adding it here does not prevent anything, but calling too many times the deprecated interface (I'm anticipating for a deprecation free 2.7)