fallback to nextTick if setImmediate is not a function