Fix test_sorted_url_encode

We use an explicit key function that sorts on the text_type
representation of the key. This is implied due to coercion rules in 2.x
but doesn't work in 3.x