U.S. stocks close lower, as Dow ends August down more than 1,000 points