Pakistan wins final test by 10 wickets