fix: define setImmediate once

IE8 and other browsers use different polyfills