[2.3] [HttpFoundation] Protect JSONResponse against CSRF attacks

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/2212