Fix #381 by caching a reference to setTimeout so it won't get replaced by fake timers