Tweak the to_io method in the ruby wrapper

Always return the same IO object.