Qt: Fix memleaks in tests