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.
Merge pull request #202 from kennytm/fix-crash-from-mr-193

Fix some segfault when printing the stack trace.