Improve messaging on startup/shutdown when profiling is enabled.

Should help fix #304