[DDMD] Clean up linkcmd

In `executecmd`, `cmd` sometimes points to a literal, sometimes an environment string, or sometimes a malloced buffer.  It is only valid to modify the latter, so instead make `cmd` const and copy before normalizing `/` to `\\`.  This function is only going to be called once per compiler run anyway.

Also, remove some dead code from inside `#if _WIN32` blocks.