cleaner exit from nThread in nWavelet and nIntegralInversions