A strategy to avoid solid formation within the reactor during magnesium and calcium electrolytic removal from lithium-rich brines