only wrap and test setImmediate if it exists