Tesla said it produced 5,031 Model 3 cars in the last seven days of its second quarter, beating its long-elusive production target after several hiccups.