Send shutdown messages to kernel from Qt console and terminal console

Should fix #6893