Added flush when writing intermediate benchmark results