If `modulecmd` dynamically links in libraries (e.g. `libtcl`), we have seen problems with modules prepending to `$LD_LIBRARY_PATH` and inserting a new (incompatible) `libtcl`, thus breaking `modulecmd`.
To get around this, we keep track of the original `$LD_LIBRARY_PATH` before loading any modules, and always use that when calling `modulecmd`.
After loading a module, we then have to do some trickery to update `$LD_LIBRARY_PATH` correctly according to the loaded module, but that already works.

For the `modulecmd.tcl` (both variants), we also need to make sure `$LD_LIBRARY_PATH_modshare` is kept in sync with `$LD_LIBRARY_PATH`, since we're adjusting `$LD_LIBRARY_PATH` outside of a module (and thus `modulecmd.tcl` can't keep the `_modshare` env var up to date).