_query.pm: Sort hash keys if given a hash.

Hashes already have an unpredictable ordering, so any code that relies
on order retention while passing a hash object is already broken.

However, there's some utility in having consistent URI's **generated**
from unpredictable hashes if those URIs ever go through a caching layer
somewhere.

I considered having some kind of tunable variable to indicate if it
sorts or not, but figured YAGNI, so didn't.