mips, x86: optimize the i8259 code a bit