fixed a bug in write_cxi() and append_cxi() where the data_1 group wasn't closed properly and oculd result in file errors when called frequently