Core/Command Line: Fix memory leak

thx jackpoz
Core/Thread:Fix race condition in FreezeDetectorRunnable