Implement `collectEntries` as trampoline.

In pure-JavaScript implementations that aggressively cache records certain test will blow the stack if `process.nextTick` is used. The warning issued suggests the use of `setImmediate` however, not all platforms may support `setImmediate`.

This implementation of `collectEntries` uses a trampoline so that invocations of `iterator.next` that do not result in an asynchronous call will not increase the depth of the stack. This eliminates recursion and prevents stack overflow.