Statistically Efficient Thinning of a Markov Chain Sampler