Adds a new mode of operation where each full buffer is handed over to external code. A new buffer is allocated and the thread continues instrumentation using the new buffer, with the external code responsible for writing it out and freeing it.
This mode is enabled via a new API routine drmemtrace_buffer_handoff(), which takes a buffer handoff routine, called instead of the write cb, and an exit routine. The exit routine provides a control point after other threads are native but before DR exits, when using dr_app_stop_and_cleanup(). Without it it would be impossible to use DR memory in the handoff and we'd need a hack like putting next pointers inside the redzones or something.
When the handoff is enabled, we disable dumping buffers at syscalls: they are only dumped (i.e., handed over) when full or at thread exit.
Out-of-memory is handled by keeping a buffer "in reserve" which is swapped to once we fail to allocate a buffer, at which point we switch to the size-cap protocol where we instrument but don't send the results anywhere.
Adds a test that accumulates all buffers and writes them all out at process exit.