NEW YORK — Stocks gave up an early rally and closed lower Friday, marking their third losing week in a…