fix crt security warnings

"getenv" function produce CRT security warning on WIN platform, I replaced it by security version _dupenv_s. I think it will be useful for projects where security warnings treated as error