[2.3] Return BC compatibility for DI Container

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8347
| License       | MIT

When setting service to `null` it's considered as existing instead of removed/reset state which is BC break, more in #8347.