[Console] guarded against non-traversable aliases

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

This patch would guard against passing non-traversable aliases to `setAliases` method.
It follows discussion about a previous [PR](https://github.com/symfony/symfony/pull/11873) which broke BC.