The head of France's armed forces has resigned after clashing with President Emmanuel Macron over proposed budget cuts.