fix regression in canonicalize

For profiles we want to accept URI paths like `/Foo/` and redirect them to a canonical representation like `/foo/`. We want to preserve any querystring when we redirect (#1349), but a too-loose test for whether we have a querystring was causing us to not properly handle an empty querystring. This PR adds a couple tests for utils.canonicalize and fixes the regression.