Make use of the new buffered writer for the output of `prof_log_stop`.
The prof_alloc_node is allocated through ialloc as internal. Switch to idalloctm with tcache and is_internal properly set.
Prof logging is conceptually seperate from core profiling, so split it out as a module of its own. There are a few internal functions that had to be exposed but I think it is a fair trade-off.