Passing to the limit in optimal stopping problems for Markov processes