lib/perl5db.pl: refactor all calls to IO::Handle via ->autoflush to a short local function.

This hopefully resovles https://rt.perl.org/rt3/Ticket/Display.html?id=116769
and any issue similar to that which I may not have been unlucky enough
to fall upon.