Pass along RuntimeError when using PyObject_IsInstance in Python 3.
fix refcount