Add reference to self in Cursor.close