On the stability of solutions to random optimization problems under small perturbations