Migration has fallen to the lowest level for three years after a surge in the number of EU nationals leaving since the Brexit vote.