add a client API for internally-triggered detach from dstack
Today our detach has some limitations: it can only be triggered from a non-DR stack: an app stack via the start/stop API, or an injected thread stack via a nudge on Windows
This issue covers a feature where a client can call a new APi routine dr_detach_process() from the dstack. We could do a raw mmap to make a stack, copy the current thread's app state there, switch to that stack, call detach_on_permanent_stack(), and then swap to the stored state. We'd just leak the mmap I guess. And no support for unloading the DR lib.