add io->autofd

maybe there is still something todo here, will care for that later.