Hungarians are voting in a referendum which is the most serious challenge yet to the European union's hopes for a collective response to the refugee crisis.