A federal appeals court has ruled that part of an obesity lawsuit against fastfood giant McDonald's was wrongly thrown out of court.