lib/worker: Be more anal about not loosing check output

When multiple checks run concurrently, we can get a signal while still
reading check output. This could cause us to forget about reading the
rest of the output. Be careful not to do that.

This fixes bug op5#8331.

Reviewed-and-discovered-by: Robin Sonefors <robin.sonefors@op5.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/worker: Stop reading if nothing more to read

In the last patch, I over-the-shoulder-programmed away the support for
exiting gather_output when the process is shutting down. Ooups.

Change-Id: I6b041736df4d05899d1686d875e42a1d3c9ce056
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
workers: Count correctly when workers are chocked

When a worker is choked, we would decrement the number of active jobs
without first incrementing them. This leads to seemingly 4.2 billion
active jobs on said worker, which makes nagios refuse to schedule any
more checks in that direction. Increment before decrementing, so the
numbers add up.

Change-Id: I85bda501b1671274750f26db0873a24e79ca9e0c
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
Merge branch 'dev/lost-output'