New Zealand claimed third place at the Rugby World Cup with a 40-17 win over Wales on Friday night.