Cristiano Ronaldo scored a hat-trick as Real Madrid survived a scare to win the Club World Cup for the second time in three years