logger: refactor code, use env interface in dlib/utils
utils: update UnsetEnv(), call C.unsetenv() firstly