Immigration to the UK from the European Union hit a record high in the run-up to the Brexit vote