[HttpFoundation] Silent only JSON errors
Catch exceptions to restore the error handler
Fix JsonSerializable namespace
Clear json_last_error
bug #11418 [JsonResponse] Silent only JSON errors (GromNaN)

This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #11418).

Discussion
----------

[JsonResponse] Silent only JSON errors

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | maybe
| Fixed tickets | #11415
| License       | MIT
| Doc PR        | n/a

Commits
-------

6d6a3af Clear json_last_error
ef91f71 Fix JsonSerializable namespace
d952f90 Catch exceptions to restore the error handler
ddf95c7 [HttpFoundation] Silent only JSON errors