Fix some segfault when printing the stack trace.

Changes since #193:
- Ensure a stale DebugEntry will not be reused.
- Actually store the node into the DebugEntry as kregs index is not stable.