Gains in defense shares as well as healthcare helped to keep U.S. stocks in positive territory on Thursday, while an end to the latest chapter in Britain’s exit from the European Union, Prime Minister Theresa May’s defeat of a confidence vote, lifted sterling.