Reformat.
Make it clear that we always terminate after rec_sched_get_active_thread returns null.
Use nullptr instead of NULL.
Clean up resume_execution a little bit.
Simplify task deletion call path a bit.

Splitting handle_ptrace_exit_event from handle_ptrace_event simplifies
handle_ptrace_event because now it doesn't sometimes destroy t.