Move close archive function from xxfi_cleanup to xxfi_close