bpo-31095: Fix potential crash during GC (GH-3197)

(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 1335ae8..0ee4b80 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -745,6 +745,7 @@
 static void
 bytesio_dealloc(bytesio *self)
 {
+    /* bpo-31095: UnTrack is needed before calling any callbacks */
     _PyObject_GC_UNTRACK(self);
     if (self->buf != NULL) {
         PyMem_Free(self->buf);