[pyqgis-console] avoids IndexError when attempts to run unselected code by keybinding Ctrl+E