Restart clone() system call until we get the PTRACE_EVENT_CLONE/FORK event we're expecting.

It's possible for a clone() system call to be interrupted, generating a
spurious syscall exit event. When that happens, the current code would get
fatally confused because it depends on the syscall exiting immediately.

Resolves #1200.
Add fork_stress test.
When a test fails due to a difference in output between recording and replay, print the diff of the results.
Add assertions to check that the encoded event data field is wide enough for its data.
Fix raw-dump header to match reality.
Make tracee writes to rr's stderr/stdout non-interruptible.

This avoids situations where multiple threads concurrently write to
stdout/stderr, in which case rr does not know which order to echo them in
during replay.

Resolves #1201.
Microoptimize syscallbuf initialization to avoid redundant gettid() syscall.
Remove spurious return statement.
Remove spurious debugging code.
maybe_create_debugger needs to carry on even if rr isn't launching the debugger itself.
Add extra syscall result checking to open_socket and print more specific failure messages.

I saw a weird test failure where open_socket hit an EINVAL somewhere. This
will help narrow it down if it occurs again.
Retry process clone syscall if we see EAGAIN during replay.
Pass PTRACE_O_EXITKILL to PTRACE_SEIZE to ensure that if rr is killed in any
way, all tracees are cleaned up.
Flush syscallbuf before terminating trace in response to SIGINT/SIGTERM.

Also makes term_trace_cpu much more aggressive about sending SIGINT
as soon as possible, before any syscallbuf flushing has happened.

This fixes an intermittent failure in term_trace_cpu where the tracee might
not reach a syscallbuf flush before it was terminated, even though the test
waited for a whole second before sending the signal. In general, this change
prevents the final lines of syscallbuf-buffered output from being lost.
Make term_trace scripts more robust and not hang waiting for tail processes to terminate which never will.
Add comments to term_trace_cpu to explain what's going on in more detail.
Make get_thread_list tolerate gdb's thread order not matching order of thread creation.

After 69 successful runs of the full test suite, this issue caused the
70th run to fail.
use __rdtsc to execute the rdtsc instruction

Anything that eliminates inline assembly is a good thing.  As a small
bonus, __rdtsc() is defined by Intel, so this code works on all
compilers that implement Intel-compatible intrinsics.
add kernel_abi.h header

This header replicates libc/kernel datastructures such that they can be
templated with member datatypes appropriate to several different kinds
of CPU architectures.  Doing this means that we can refer to how x86-64
defines, say, |struct msghdr| and how x86 defines |struct msghdr|
without fighting with C/C++'s idea that there must be One And Only One
|struct msghdr|.
make syscall types use types from x86_arch instead