Tesla employees have filed lawsuits over alleged harassment inside factories—and California regulators are bringing a civil-rights complaint against the company.