[Ide] Call NSApplication.Terminate when exiting. Fixes #14789