minor #43778 Use try/finally to restore error handlers (derrabus)
minor #43778 Use try/finally to restore error handlers (derrabus)

This PR was merged into the 5.4 branch.

Discussion
----------

Use try/finally to restore error handlers

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

This PR attempts to make some code dealing with temporary error handlers a bit more robust by making sure the old error handler is always restored. A forgotten error handler is pretty hard to debug, so I'd like our code to be a it more defensive here.

Commits
-------

057716c6a2 Use try/finally to restore error handlers

symfony/security-http