The main U.S. stock indexes closed slightly higher on Friday and marked weekly gains after Trump hinted at flexibility on a new round of tariffs set to go into effect next month.