[HttpFoundation] fixed the creation of sub-requests under some circumstancies (closes #6923, closes #6936)

This fixes the creation of a sub-request when the master request Request URI
is determined with specific server information.
merged branch fabpot/request-uti-fix (PR #6966)

This PR was merged into the 2.0 branch.

Commits
-------

ddf4678 [HttpFoundation] fixed the creation of sub-requests under some circumstancies (closes #6923, closes #6936)

Discussion
----------

[HttpFoundation] fixed the creation of sub-requests under some circumstancies (closes #6923, closes #6936)

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

This fixes the creation of a sub-request when the master request Request URI
is determined with specific server information.