bpo-39573: Use Py_REFCNT() macro (GH-18388)

Replace direct acccess to PyObject.ob_refcnt with usage of the
Py_REFCNT() macro.
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 527693c..c0eff8b 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -85,7 +85,7 @@
                             "EOF when reading a line");
         }
         else if (s[len-1] == '\n') {
-            if (result->ob_refcnt == 1)
+            if (Py_REFCNT(result) == 1)
                 _PyBytes_Resize(&result, len-1);
             else {
                 PyObject *v;