Fix Ctrl+D Crashes and Freezes (#296)

Cleaned version of https://github.com/p-e-w/finalterm/pull/306
It should never be slow :)

But you are right, theoretically. Only workaround I see would be to send the PID via the fifo and copy the static terminal_by_pid-approach. But maybe we could wait and see whether this really becomes a problem?