After ultimately winning the House speaker vote, McCarthy thanked Trump.