Fix regression in environment() (#1745)
Fix regression in environment() (#1745)

My stupid bug, introduced during a minor refactoring related to the
static analysis from two commits ago. The static analysis was right,
by my fix to an apparent possible null ptr dereference was flawed. I
avoided the null dereference, alright, but broke some other logic in
the process.
lgritz/oiio,lgritz/oiio,OpenImageIO/oiio,lgritz/oiio,OpenImageIO/oiio,OpenImageIO/oiio,OpenImageIO/oiio,lgritz/oiio