Hershey workers in the US have approved plans that will see the chocolate giant phase out production at the company's original factory.