Tesla posted a wider loss in the third quarter as costs to launch its new Model X led to a 10th-consecutive quarter of red ink—but shares rose after hours as the company forecast fourth-quarter deliveries that showed the Model X could still hit its sales targets.