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