Karen Roberts said on LinkedIn on Tuesday that she is stepping down as general counsel of Walmart and leaving the company, ending a 27-year career with the retail giant.