Tesla recalls 362,000 vehicles over self-driving software flaws that risk crashes