support StingIO in Net::BufferedIO monkeypatch