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