The president started his visit to Ankara berating the NATO alliance. Something changed before he left.