[profiler] Guard against null sbuff when serializing statistical data.