Switch use of threads on defined(CAVERNLOG_USE_THREADS)