A worker accused of "stealing" snacks has finally been acquitted after a legal battle lasting nearly two years.