An envelope method for solving continuous-time stochastic models with occasionally binding constraints