Fix Ctrl+D Crashes and Freezes (#296)

Cleaned version of https://github.com/p-e-w/finalterm/pull/306
It could of course instead use the old approach and go with a with a foreach  through the children.