In my investigations into heap allocations during IBD, I discovered that ThreadRename is called many many times, in some cases it does multiple string allocations as well. This modifies ThreadRename to not allocate memory, opting for a static thread-local buffer instead.
I also create a new ThreadRenameWithWorker helper to avoid strprintf allocations.
before:
after: