esm, doc: fix and improve specifier resolution warning
This is a response to https://github.com/nodejs/node/issues/42116#issuecomment-1059046760. Our docs and warnings shouldn’t give the impression that --experimental-specifier-resolution
is somehow safer than custom loaders.
This PR also fixes a bug, that the experimental warning which should be output whenever --experimental-specifier-resolution
is passed didn’t seem to be getting output in most scenarios. I moved the code that prints the warning to an earlier spot in the flow and added a test.
@nodejs/loaders