Fixes compile bug with TRACE_LOCKS

Bug added by dd7d3f0, when the irq_state variable was moved into an 'if' block.