Stability of solutions of the double obstacle problem on metric spaces