libbacktrace: rewrite and simplify main zstd loop