add isIdle() method

Added isIdle() method to check if interrupt code is "receiving" a new IR
code. Wait until idle before starting another long running time critical
code with noInterrupts() inside.