Cherry-pick fixes from bugfix/9971_sofw_crash_debug_log into next

Changes:

    Speed up the debug logging in SofQW3

    It now accumulates the debug messages and logs per spectrum rather
    than calling the logger for every spectrum & bin.
    Refs #9971
    (cherry picked from commit df740772715ead4dd63a239b640708a5be709eb7)