A US appeals court has rejected a ruling that would have allowed millions of Ohio residents to sue 3M, DuPont, and others as a group over contamination by so-called toxic "forever chemicals."