[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