Issue #6697: Check that _PyUnicode_AsString() result is not NULL in _sqlite

Strip also some trailing spaces
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 0aa78f4..54a89e1 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -83,6 +83,8 @@
         return item;
     } else if (PyUnicode_Check(idx)) {
         key = _PyUnicode_AsString(idx);
+        if (key == NULL)
+            return NULL;
 
         nitems = PyTuple_Size(self->description);