libshell|EditorHistory|Console: Empty commands not put in history

Also, when dismissing unentered content from the console command
line, make sure it's the latest entry in the history that gets
saved rather than whichever historical entry was currently in the
editor.