misc/nit_env.sh: add support for zsh and fix fallback creating a file