job_container/cncu: save/restore state file as needed