bpo-39573: Use Py_TYPE() macro in Objects directory (GH-18392)

Replace direct access to PyObject.ob_type with Py_TYPE().
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c
index ddad39a..5c7163f 100644
--- a/Objects/namespaceobject.c
+++ b/Objects/namespaceobject.c
@@ -73,7 +73,7 @@
     const char * name;
 
     name = (Py_TYPE(ns) == &_PyNamespace_Type) ? "namespace"
-                                               : ns->ob_type->tp_name;
+                                               : Py_TYPE(ns)->tp_name;
 
     i = Py_ReprEnter(ns);
     if (i != 0) {