A forceful police response has led to thousands of arrests in what has become a flashpoint in the French presidential election.