Ben Smith scored two tries as New Zealand claimed a 40-17 win over Wales in the Rugby World Cup bronze final.