Fix a bug which would cause a failure to report how many messages were processed

Change-Id: I475e003904d101180780832d58708e2203b63997
(FR #1436) Add a job time limit to queue processing modules

This makes it possible to guarantee that jobs do not overlap, and makes the
batch run behavior independent of system load.

The patch incidentally fixes a bug where the number of messages processed was
sometimes being incorrectly reported as zero.

Change-Id: If954138ce34aaf67a01d266ee211b0578919a4f3