[HttpFoundation] factorize out the way output buffers should be closed
minor #10726 [HttpFoundation] factorize out the way output buffers should be closed (nicolas-grekas)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[HttpFoundation] factorize out the way output buffers should be closed

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

Closing output buffers was done in three different files, but not exactly the same way, with subtle differences.
This PR factorizes out the best way to do this in a new public static function of the Response class.

Commits
-------

469943c [HttpFoundation] factorize out the way output buffers should be closed