Make recursive rmdir more strict
This PR changes the behaviour of recursive rmdir (rimraf) in the following ways:
- Throws an exception when the path to remove does not exist
- Throws an exception when the path to remove points to a file instead of a directory
These changes are based on the discussion in #35171
cc @nodejs/tooling
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