nsh: fixed syntax checking in env variables expanding