Avoid unnecessary allocations in try_parse_url.