Tesla posts record loss of $671 million in Q3