Fix how to safely use is_granted in error pages

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no 
| Applies to    | 2.1+
| Fixed tickets | #2078

See https://github.com/symfony/symfony-docs/commit/df85a35e69707a34a63f5cf0ff85c4cc5cf1eab1#L0R59