A 22-year-old man is in custody after surrendering to police over the killings of five people shot dead near Dunkirk, in northern France, according to authorities and local media.