Various fixes

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12278
| License       | MIT
| Doc PR        | -

A 3 in one PR (diff is best viewed with whitespaces ignored):
- changed the way the DebugHandlerListeners desactivates itself
- reduced a N×N iteration by a N one in ContainerAwareEventListener::removeListener
- fixed an issue in VarDumper