Fix the nextTick(cb) causing event loop starvation

If you run more than 1000 lookups (like processing a big directory of
files), you will get lots of warnings from node.  Solution is to use
setImmediate(cb) instead.

Unfortunately, I could not figure out how to assert that a warning does not occur, but if you run the test I added without the fix, you will see several warnings (at least in windows with node 10.26