US economic growth unexpectedly picked up steam in the second quarter, boosted by stronger-than-forecast consumer spending and robust business investment.