[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        | -
@nicolas-grekas this change is broken if the child definition overwrites only one of the parts of the factory but not the factory method. It is a BC break (it won't be supported anymore in 3.0 though, because you will have to overwrite the whole factory and it is a weird case anyway).