Fix crashes in testTerminalInterface
Certain user profiles crash here
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5 this=0x5555557c8da0, name=..., visible=true) at src/konsole/src/session/SessionController.cpp:2206 mode=1) at src/konsole/src/Screen.cpp:2395 at src/konsole/src/Vt102Emulation.cpp:1071 this=0x555555dc2a30, cc=7)
(cherry picked from commit 5bda5740)