I suspect this is a very, very old but un-addressed bug.
Shot in the dark, but try it.
Check the option under Preferences\Display: Show midi activity on the windows taskbar
If it is checked, uncheck it.
Recreate a hang condition.
Kill Sonar.exe in the task manager.
If Sonar.exe quits, that's your problem
Sonar
IS trying to exit but being hung by the midi driver process/icon in the taskbar.
I have checked to make sure this option is off since Sonar 3 Producer.
Like I said, shot in the dark, don't shoot me if I'm wrong.
Mel