Use Qt5 QSignalSpy::wait() instead of sleep()
I only noticed on DragonFlyBSD that the TerminalInterfaceTest failed w/o this patch.
Differential Revision: https://phabricator.kde.org/D8420