Bound the size of debug messages.

Change ?sprintf to ?snprintf in do_debug.

This fixes Neil's segfault. _MAKEFLOW_COLLECT_LIST gets immense, which
was bothering vsprintf.
Wraps monitor with category.

Also, move codes around so that the wrapping for the monitor and batch
options get the same scope.
Consolidate monitoring in a single function
Stop and report when rule goes over limits