process: Deal with infinite looping of the server

Currently if an exception occurs, we just run the idle handler again and
again, usually looping indefinitely. Chances are the exception that occurred
will keep occurring and this is not a good place to be.

This was breaking the autobuilders with gigabytes of logs.

At least improve things so the cooker shuts down gracefully when this happens.
Some trace of the original problem may still be present on the console too!

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
process: Further improve robustness against server shutdown

Currently, if an exception occurs in an event handler, the server shuts
down but the UI simply hangs. This happens in two places, firstly waiting
for events and secondly, sending events to a server which no longer exists.

The latter does time out, the former does not. These patches improve
both code sections to check if the main server process is alive and if not,
trigger things to shut down gracefully. This avoids the timeout in the
command sending case too.

This resolves various cases where the UI would simply hang indefintely.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
knotty: Improve exception handling

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>