Ringbuffer

This branch fixes two bugs in the ringbuffer code:

- qb_log_target_formats() does not support formatting size_t values with
%zd.  Use %ld to format them as long integers instead.

- qb_rb_open() expects the size field to represent the maximum chunk size.
It adds QB_RB_CHUNK_MARGIN + 1 and rounds up to the page size to
determine the ringbuffer's total size. When creating a ringbuffer from a
file we must compensate by subtracting this amount from the file's size.