Optimal stopping of switching diffusions with state dependent switching rates