The U.S. expanded at a 3% annual pace in the second quarter, masking signs of weakness in the economy as businesses and consumers grappled with how to respond to ongoing trade wars.