Fix regression in thread name reporting in the profiler.

metadata/threads.c: fix regression from the 695b17f8d5967c7 change and
avoid useless memory allocation. Report thread name to the profiler at
thread startup if it was set before that.
profiler/decode.c: fix typo.
profiler/proflog.c: ensure we get a consistent first buffer header at runtime
initialization.