Tesla posts wider Q2 loss; revenue climbs