use setImmediate when available instead of process.nextTick

In node 0.9+, recursive use of process.nextTick emits a warning (and will soon break).

The warning says to use setImmediate for recursive deferral.  This pull request makes this change.

Tested against 0.8.9 (which lacks setImmediate) and 0.9.9 (which has it).