Rewrite XYZ file header with updated number of atoms