Discounted optimal stopping for diffusions: free-boundary versus martingale approach