optimized circular reference checker
merged branch tgabi333/master (PR #8891)

This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8891).

Discussion
----------

[DependencyInjection] optimized circular reference checker

| Q             | A
| ------------- | ---
| Bug fix?      | [no]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | no]
| Tests pass?   | [yes]
| Fixed tickets | []
| License       | MIT
| Doc PR        | []

It is an addtion to my previous PR https://github.com/symfony/symfony/pull/7699

There is no need to check again previously checked sub-trees.

In our tightly coupled services graph, this circular reference check runs avg 1,5ms, before that: 100ms

Commits
-------

67ebf8f optimized circular reference checker