How migration policies moderate the diffusion of terrorism