Macaques on the Rock of Gibraltar have started eating soil to calm stomach upsets caused by junk food from tourists.