Reorder detach cleanup and detach callback
Reorder detach cleanup and detach callback

This should make it easier to allow a detached callback to reattach
immediately without leaving the debugger state inconsistent.

Requires careful handling of the detach/reattach sequence:

- Both the detached callback and its udata must be stashed, state cleared,
  and only then the detached callback can be called.

- When the Detach command has been handled, must avoid skipping to EOM
  because that would happen in a potentially new connection which would
  cause that connection to be out of sync.  Returning to the message loop
  is fine, and since duk_debugger_attach() marks the state dirty, a Status
  will be immediately sent (followed by the handshake line, sent inline by
  duk_debugger_attach()).

tassmjau/duktape,harold-b/duktape,markand/duktape,jmptrader/duktape,markand/duktape,harold-b/duktape,markand/duktape,markand/duktape,harold-b/duktape,markand/duktape,markand/duktape,svaarala/duktape,jmptrader/duktape,harold-b/duktape,tassmjau/duktape,markand/duktape,jmptrader/duktape,jmptrader/duktape,harold-b/duktape,jmptrader/duktape,jmptrader/duktape,harold-b/duktape,markand/duktape,svaarala/duktape,harold-b/duktape,markand/duktape,markand/duktape,tassmjau/duktape,svaarala/duktape,svaarala/duktape,jmptrader/duktape,svaarala/duktape,tassmjau/duktape,tassmjau/duktape,svaarala/duktape,tassmjau/duktape,jmptrader/duktape,harold-b/duktape,svaarala/duktape,tassmjau/duktape,harold-b/duktape,tassmjau/duktape,svaarala/duktape,harold-b/duktape,jmptrader/duktape,jmptrader/duktape,tassmjau/duktape,svaarala/duktape,tassmjau/duktape