Re-use emergency_debug() in the recording code.

I started to polish up the dopey detach-and-exec-gdb code I'd been using for testing, but then I realized the `emergency_debug()` code doesn't care whether it's running on behalf of a recorded or replayed task at all, since it will never try to resume execution.  So we get to repurpose the helper "for free".  Resolves #216.