hw: prevent from off-by-one bugs in PIC classes

Instead of using Pic::MAX_INTERRUPT_ID this commit introduces more
conveniently the Pic:NR_OF_IRQ.

Ref #1169