Fix error in batch scanning, which led to a unittest failure in random

runs for MVCC stats.