bpo-29802: Fix reference counting in module-level struct functions (#1213)

when pass arguments of wrong type.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index ef2215f..b680421 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3907,6 +3907,7 @@
     PyObject *output = NULL;
     if (arg == NULL) {
         Py_DECREF(*(PyObject**)addr);
+        *(PyObject**)addr = NULL;
         return 1;
     }