The meeting between President Trump and the incoming mayor of New York City was strikingly warm for two men who had expressed deep concerns about each other’s leadership.