fix panic when passing empty environment

Docker-DCO-1.1-Signed-off-by: Sridhar Ratnakumar <github@srid.name> (github: srid)
Merge pull request #5833 from ActiveState/fix_nsinit_env_panic

fix panic when passing empty environment