[ruby-core:122248] [Ruby Bug#18455] `IO#close` has poor performance and difficult to understand semantics.