Write sorted run to a temporary file.