[system.net.http] Update range checks for invalid characters. Fixes #18800