Mondelez International has ended discussions with Hershey over a potential acquisition, the Cadbury owner has announced.