The Optimal Population Size under Pollution and Migration Externalities: a Spatial Control Approac