[DependencyInjection] Tweaked factories
minor #12065 [DependencyInjection] Tweaked factories (unkind)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[DependencyInjection] Tweaked factories

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12008
| License       | MIT
| Doc PR        | n/a

There are some issues with new service factories:
 * `ContainerBuilder` cannot instantiate service from factory (i.e. currently it works for dumped code only)
 * Dumped code sometimes is invalid (anonymous services as factories, factories without arguments)

Commits
-------

ee82392 [DependencyInjection] Tweaked factories