[HttpFoundation] Fix unexpected status code on a FastCGI server

<table>
  <tr>
    <th>Q</th><th>A</th>
  </tr>
  <tr>
    <td>Bug fix?</td><td>yes</td>
  </tr>
  <tr>
    <td>New feature?</td><td>no</td>
  </tr>
  <tr>
    <td>BC breaks?</td><td>no</td>
  </tr>
  <tr>
    <td>Deprecations?</td><td>no</td>
  </tr>
  <tr>
    <td>Tests pass?</td><td>yes</td>
  </tr>
  <tr>
    <td>Fixed tickets</td><td>#8085</td>
  </tr>
  <tr>
    <td>License?</td><td>MIT</td>
  </tr>
</table>

- [ ] Add tests if possible
- [ ] Add FastCGI server detection for set the header only if needed