src: use ToLocal in SafeGetenv
This commit replaces the IsEmpty call to use ToLocal instead which allows for the following ToLocalChecked function call to be avoided.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines