Improve URL escaping in CDX writer