Closed-loop control of plasma current and toroidal field in RFX