call DpiRemoveAll() on exit to fix mem leak; in debug mode wait a bit to give DeleteWatchedDir() to take place so that it's not reported as memory leak