[ruby-core:127175] [Ruby Bug#22456] IO#close hangs forever when another thread is writing to the IO from a trap handler (please backport ba68343d3a to 3.4)