Remove calls to threading functions when KDT_THREADING is not defined