The president has supported Elon Musk throughout protests against Tesla, but he hasn't always been on the side of electric vehicles.