Use portable PT_DETACH, instead of PTRACE_DETACH.