The U.S. economy grew at a slower rate in the second quarter as surging imports masked strong underlying demand.