Temporary fix for potential deadlock while running multithreaded jobs.
Made a lot of debug output only appear in debug builds.