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