Use setImmediate when available.