Government to end free movement if a no-deal Brexit