Build: Fix perf test to take median of three runs (fixes #781)