Flush stdout/stderr before closing pager process

Ensure all output is sent to the pager by flushing stdout
and stderr before closing the pipe to the pager process.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix association of comments with patchsets

A string prefix on the patch set number fails when we
get more than 10 patchsets because '2' is a prefix
of '21'. Ensure we match the complete patchset number.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>