Straggler Mitigation in Distributed Optimization Through Data Encoding