hw/core: Add interface to allocate and free a single IRQ