Tesla is buying lidar sensors, according to Luminar Technologies Inc., a development that marks an 180-degree turnaround from Elon Musk’s earlier deriding of the laser-based sensors.