fix missing clean state for re-attach
previously switching the inferior may used old symbol data instead of the one from the new inferior
note: the result of this PR is "not "a bit" tested, the first test does fail on Ubuntu, but I guess it will pass on RedHat based OS possibly; if there are still errors then those should be relative easy to fix.
supersedes !157 (closed) (which contained an error)