[v9.x backport] tools, test: fix prof polyfill readline
Backport of #18641 to v9.x, with only trivial conflicts.
Refs: https://github.com/nodejs/node/pull/18641
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
tools, test