convert.py: Replace type checks with isinstance.

Lines 97 and 99 fix `str` and `unicode` subclasses raising `ValueError`, e.g. `lxml.etree._ElementStringResult`. Change line 76 for consistency.