Stability of gradient semigroups under perturbations