French voters have denied the far-right a victory in elections that have left political uncertainty ahead.