[Security] Fix ExceptionListener to catch correctly AccessDeniedException if is not first exception

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9544
| License       | MIT
| Doc PR        | 

My after HackingDay contribution :) @jakzal.
The problem was with "while" loop which extracts only the first exception.
Now the Listener walks through all exceptions and checks if there are any security exceptions