bugfix: end of batch processing was not 100% correct.

Could lead to outputs not properly wirting messages. At least
omelasticsearch did not write anything to the database due to this bug.
See: https://github.com/rsyslog/rsyslog/issues/10
Thanks to Radu Gheorghe for reporting the issue.