[SecurityBundle] Don't use deprecated code in LogoutUrlHelper

| Q             | A
| ------------- | ---
| Bug fix?      | kinda
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10249 (this PR is an alternative approach)
| License       | MIT