[BUGFIX] TypoLink: absolute urls when installed in subfolder

If you have TYPO3 installed in a subfolder and a domain
record with that subfolder (localhost/subfolder/ for
example) TYPO3 only generates absolute links in the
frontend.

This is because the typoLink function compares the
HTTP_HOST var with the domainRecord. HTTP_HOST is in
this case "localhost", the domain record has the subfolder
attached. The subfolder needs to be there, as otherwise
t3lib_pageSelect::getDomainStartPage does not find the
start page anymore. typoLink should check for HTTP_HOST +
path of SCRIPT_NAME to determine which domain record
to use (same as getDomainStartPage already does).

Change-Id: I4832be934baa63a57b6c16c48c7420102d8b0d5d
Fixes: #33214
Releases: 4.5,4.6,4.7
Reviewed-on: https://review.typo3.org/9073
Reviewed-by: Philipp Gampe
Reviewed-by: Sebastian Fischer
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Stefan Neufeind
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack