st/mesa: change some loops from while to do..while in st_atom_array.c