setImmediate shim for browsers