fix reference problem that calls _Py_NegativeRefcount in Python debug build