Fix Ctrl+D Crashes and Freezes (#296)

Cleaned version of https://github.com/p-e-w/finalterm/pull/306
Given that this loop breaks in the first iteration no matter what, the entire loop must be equivalent to
```
Posix.waitpid(-1, null, Posix.WNOHANG);
```
or am I missing something?