Debugger: Fix crash when accessing `process.env` from WebStorm

I fixed the crash, but I haven't figured out what's the situation that causes env to be corrupt.
AFAICT is not made redundant by #7512