python: update following the change to cs_close() API in the core