[ruby-core:121322] [Ruby master Bug#21151] IO and StringIO raise FrozenError even for read-only methods