Globalization and the gains from variety: size and openness of countries and the extensive margin