fix bug in ios.c when using takebuf on a file stream

this is a strange thing to do, but I managed it while bumbling with
trying to use Compose in IJulia
use show() to show key when showing a KeyError