[fixed] Path.withQuery strips query if query is empty

Hi there,

`Path.withQuery` did not strip off the query once it became empty. Here's a fix + test. :smiley: 

Cheers,
Max