Some early dinosaurs consumed charcoal to cleanse stomach after eating toxic ferns, study says