Fix reference problem that would call _Py_NegativeRefcount in python debug build