Nasdaq Ends August with Losses, but Closes Higher for Fifth Straight Session