Fix segmentation fault when parsing malformed URLs (e.g. "http:/").