allow unicode URLs on Python 2

on Python 2 u'é'.decode('utf8') fails with UnicodeEncodeError,
but only AttributeError is caught.

This only calls decode on known bytes objects.
Merge pull request #2267 from minrk/unicode-url-py2

allow unicode URLs on Python 2