[RM plugin] cleanup slurm component: close fd after env restore.