fix of putenv warning under safe mode, issue #646