use setImmediate when available

future-proofs for node 0.9+ (tested in 0.8.9 and 0.9.9)