Use Qt exit function rather than system one.