EU court censures Hungary over migrant detentions