Active control for current dissipation of runaway electrons in TCV