Allow limiting the size of the batched messages

If enough large messages are sent in a short period of time, the request body
could be larger than the server accepts. This patch allows limiting the size
of the batched messages. If a message is added which would cause the batched
messages to exceed the allowed size, the batched messages are flushed before
the new message is added to the outbox.

It is left as an application concern to limit any individual message from
being too large.

If this patch is something that you are interested in, then I can write tests for it. And also, consider mitigating any possible performance impact this may have.