The U.S. trade deficit narrowed more than expected in August as imports declined, but trade could still subtract from economic growth in the third quarter.