Nearly 5,000 have been arrested as France's student protests spread, with police warning of rising violence.