build,win: fix Python detection on localized OS
This code previously assumed the default value was always printed to the console by reg.exe as (default)
, but this is not true on localized versions of Windows and can contain spaces.
Fixes: https://github.com/nodejs/node/issues/29417
cc @targos @nodejs/platform-windows
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