two query fixes

- even more robust error handling in next query task. The previous
logic could sometimes run into an unhandled exception when the
channel was already closed
- mesh source aggregator now once again defers removing itself
from the pipeline. This is required for it to continue to receive
channel writability updates