Dynamical stability of autocatalytic sets