fix a race condition in examples.diskperf.

as Heller pointed out.