Remove instance variable @pos,@buf

instance variable can not sync to duplicated IO object.
remove internal method _ungets and _read_buf since not use
Adjust indent and white space