bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)

(cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 351317e..d43286a 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1138,6 +1138,10 @@
 static int
 pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored))
 {
+    if (isolation_level == NULL) {
+        PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+        return -1;
+    }
     if (isolation_level == Py_None) {
         PyObject *res = pysqlite_connection_commit(self, NULL);
         if (!res) {