Separate allocating the trace buffer from starting

This API makes things easier for mirage, but it might also be useful to
allow starting or resuming tracing more quickly in future.