New Zealand beat Pakistan in an away Test series for the first time in 49 years