Tesla has settled a lawsuit brought by the family of a Model X owner who was killed while using the company’s Autopilot feature, averting a high-stakes trial involving Elon Musk’s electric carmaker, which has faced stiff criticism for its self-driving technology.