Extract duplicate pager writing code into a method
Solve the broken pipe problem in a better way

In 20788ec696c6fa658bc72b679cfc487727dce5c7 the issue #26 was solved by
replacing the "puts" call by "syswrite". While this change worked, it
wasn't obvious from the code why "syswrite" was used. It is also likely
that "syswrite" swallows other errors than just Errno::EPIPE. That way,
legitimate errors could be hidden.

This commit restores the "puts" call and replaces the original fix by a
more targeted one (catching and ignoring a specific exception)
Merge branch 'issue-26-better-fix'