The US court of appeals has upheld a dismissal of an antitrust lawsuit against confectioners Hershey, Mars Inc and Nestle.