Fix profiling with C API (#710)
Fix profiling with C API (#710)

Currently, when using OrtEnableProfiling to enable profiling using the C API,
the profile output file is created but is always empty.

The reason is that InferenceSession::EndProfiling() needs to be called to
write the profiling data to the output file.

However there's currently no way to call this function via the C API.

This adds a call to EndProfiling() to the descructor of the session if
profiling is enabled in the session options.



microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime