GRIM: Clean up io_readfrom with suggestions from Coverity