TailMachine and RunSushiJSONServer: add waiting and kill tail-thread at exit