HSEARCH-1722 Fix race condition in OptimizerPerformanceTest