Properly cleanup after debugger termination (either by the user or programtically)