Added shutdown hooks to the console - which are called when the console
is shutdown using a method of the console, independent of the host
application like an app-close button click in UIConsole.