New Zealand has become the second country, after Japan, to ratify the Trans-Pacific Partnership (TPP) trade pact following the US's decision to pull out from the deal.