let workers exit gracefully

This PR lets workers finish handling the current batch before exiting gracefully. This not only avoids errors in the rabbitmq logs, but it should also reduce lost messages (we ack before postprocessing, another PR that fixes this is in the works).

I try to keep these PRs atomic, but splitting them up makes them conflict with one another. Sorry for that, I'll be happy to rebase on request.