Fix delta-encoding of performance-log backtraces in certain cases, and distinguish between empty call-stacks and removed threads. (cherry picked from commit eec1e1f1)