Optimized algorithm for mersenne_twister_engine::discard.  Fixes #6706.