With billions invested in Shanghai, the Tesla chief has much at stake in the next administration’s plans.