Low: libcrmcommon: new function for draining and quitting a main loop
We have an existing drain function to drain events based on a check function
and a timeout, which is better suited to daemons. This one drains up to N
events and then quits the main loop, which is better suited to tools.