Debugger stability fix.

* Apparently, the debugger should not detach when terminating the
process.
* The DBG_TERMINATE_PROCESS was not handled properly by the system.