New Zealand have won the third one-day-international against Pakistan by 43 runs to whitewash their series at home.