fix query_param encoding

This fixes a bug where an exception is thrown for any non-ascii chars in query_param for both `h.url.build` and `h.base_url`.

That bug is a regression from e9c6a2c. See also #782 because it also deals with unicode issues in urllib.