ide: fix refcounting in device drivers