src: fixed missing cursor.close()