This should fix Bug 348478 [1].
To reproduce the issue:
- open a konsole window and open more than one tab
- detach one of them
- close the detached tab
- try to use e.g. the Edit menu, it doesn't work
The issue is that _pluggedController in sessionFinished() after closing the detached tab doesn't point to the SessionController of the "session" from the sender, but actually points to the SessionController of the session of the tab that's active in the original window; so calling unplugController on it messes up the menus.