I think your solution is more responsible than the original, but with the above code if we fail on the `@write_io`, we will never attempt to close the `@read_io`.