Stocks closed broadly lower on Wall Street on Friday after Amazon and other big companies reported disappointing results.