Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff, said calls to his Chinese counterpart at the end of President Trump’s term, and a meeting where he told generals to alert him if Mr. Trump tried to launch a nuclear weapon, were in line with his duties.