Rename TraceOfstream::flush to TraceOfstream::close.

When we implement compression, it's annoying to implement flush-without-closing.
Add CompressedReader/Writer for multithreaded zlib compression of streams.
Use CompressedReader/CompressedWriter for trace I/O.

Resolves #700.
Add -s option to 'rr dump' to dump statistics --- currently, compression statistics.
Add -b option to 'rr dump' to dump syscallbuf records.
Better error checking.
Disable slack in advance_to.
Treat any unexpected exit as an unstable exit. This ensures SIGKILL triggers unstable exits.

Resolves #1285.
Make ptrace-using functions more resilient to ESRCH errors due to target process being killed.
Don't update trace events if there is a ptrace event pending.

There could be a pending PTRACE_EVENT_EXIT due to unexpected SIGKILL of the
tracee. In this case we just need to bail out and return to the point where
the ptrace event can be processed.
Simplify guards around ptrace_handle_event.
EXIT events don't need EXEC_INFO, and sometimes can't get it since we can't get registers from a zombie process.
Modify waitpid timeout logic to always interrupt the waitpid, and synthesize a PTRACE_EVENT_EXIT when doing a waitpid for a zombie process.

This is needed to work around strange issues where a waitpid() for a zombie
process sometimes does not return.
Suppress conversion of ptrace stops to rescheds in wait() called from spawn().
SIGKILL tests.
Make stop_sig_from_status assertion emergency-debuggable.
Refuse to record non-ptrace events for tasks in an unstable exit.

We can't replay these events.
Convert exit codes to PTRACE_EVENT_EXIT events.

These exit codes should not be seen --- a PTRACE_EVENT_EXIT usually comes first
--- but we are seeing them with no preceding PTRACE_EVENT_EXIT.
Disarm resched events while we single-step to a safe place to deliver a signal.

We were disarming those events only at some points. Disable them at all points
except during untraced_syscall.

This still doesn't handle the case where we single-step into an untraced
syscall and desched event arrives during that call.
Fix up detach_and_reap() to aggressively PTRACE_DETACH, and let it do all reaping; don't call wait() from kill().