BMW has reported its biggest profit in two and a half years following a second quarter surge in sales in China and the US.