Add reference to self in cursor.close