Reset internal debugger state when reconnecting

Fixes some interesting issues that happen after a detach command; it likely
misses some variables.