Fix crash on malformed port in Host header (#17572)