Always encode GET parameters back to bytes before calling urllib.quote()

When building the pagination links, the webapi code will iterate through all
the query parameters (excluding those related to pagination). These would then
be passed into urllib.quote(), which doesn't handle unicode strings (only
bytes).

This manifested itself in the users list API when a query parameter had unicode
characters in it.

Testing done:
Ran new unit test before and after the code change. Saw that before it
reproduced the bug, and after it worked fine.

Reviewed at https://reviews.reviewboard.org/r/5732/
Merge branch 'release-0.7.x'