Revert "Make Qt4_tests take test num as argument again"

This reverts commit 471d0bf038f08668988116a143172d436cb82173.
Clean up some code, and properly exit threaded qt4 widget