Add Python 2.x compatibility for urllib's urlencode