Don't attempt to close a closed IO object

Because the yield runs arbitrary application code it's possible the
underlying file descriptor is closed during the block.
This prevents developers from having to wrap all `CSV.open` calls in a `begin`...`rescue` block to catch `Errno::EBADF`