use a ternary assignment for query portion

to avoid calling `[0]` on `null` when `pth.match(QUERY)` doesn't match anything. 

It looks like your last patch for query strings caused this to happen for `url()`s in css with no querystrings. Are there tests I should run?