Improve handling of local variable settings in Eshell
This ensures that these commands work the same as normal commands,
aside from making environment variable settings local to that command.
Among other things, this means that "VAR=value cd dir/" now changes
the directory correctly.
* lisp/eshell/esh-var.el (eshell-in-local-scope-p)
(eshell-local-variable-bindings): New variables.
(eshell-var-initialize, eshell-set-variable): Use
'eshell-local-variable-bindings'.
(eshell-handle-local-variables): Don't use 'eshell-as-subcommand'.
* test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/cd):
New test.
(cherry picked from commit
65829b27ca4898ff0905a8124980243977a1382f)