Pakistan win thriller for first Windies series victory