LUCENE-6735: fix TestEarlyTerminatingSortingCollector.testTerminatedEarly failure (merge in revision 1694742 from trunk, 1694743 from branch_5x)