fs: add synchronous retries to rimraf
This PR builds on https://github.com/nodejs/node/pull/30784 and https://github.com/nodejs/node/pull/30783.
The third commit in this PR gives the synchronous version of rimraf the same linear retry logic as the asynchronous version. Prior to this commit, sync rimraf kept retrying the operation as soon as possible until maxRetries
was reached.
Fixes: https://github.com/nodejs/node/issues/30580 Refs: https://github.com/nodejs/node/pull/30569
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines