Collective marking for adaptive least-squares finite element methods with optimal rates