A Least Squares Q-Learning Algorithm for Optimal Stopping Problems