bootstrap: split NodeMainInstance::Run() and move handle checking code to the snapshot builder
bootstrap: split NodeMainInstance::Run()
Split the running of the instance so that it can be reused by the snapshot builder when we need to run the loop for user code.
bootstrap: move event loop handle checking into snapshot builder
This is only necessary for the snapshot builder (because we have no way to resurrect the handles at the moment). In addition, print the handles if the debug flag is set or if the queues are not empty after snapshot is created.
Refs: https://github.com/nodejs/node/issues/35711 Refs: https://github.com/nodejs/node/pull/38905