Cadbury has lost its Royal Warrant after 170 years, ending a historic connection with the British monarchy.