Trade-Induced Production Upgrading and the Global Imbalances