On the stability of projected dynamical systems