Hershey is to cut its global workforce by around 15% as part of a drive to save costs and make the confectionery giant more profitable.