Core/Misc: Fix abort() on shutdown on *nix

Wait for cliThead to exit before deleting it to about std::abort() triggered on *nix systems.