Officials confirmed that the N.S.A. managed a system that had been used for sexually explicit chats and L.G.B.T.Q.