Managing power dissipation in closed-loop reverse electrodialysis to maximise energy recovery during thermal-to-electric conversion