The electric-car maker, reporting another quarterly loss, is scrambling to root out glitches in the manufacturing of its first mass-market offering.