debug-console: Move cursor to end before inserting text. Fixes #162.
debug-console: Clean up appending of text.
Fix saving geometry if mainwindow is closed on shutdown. Fixes #159.