ihandle: Refactor ih_open to split out ih_attachfd