Fix temporary paths in both MSYS and MSYS2.

  * $ORIGINAL_TEMP isn't actually exported from /etc/profile in MSYS2, switching to $temp.
  * MSYS actually does define $MSYSTEM, so we now rely on the absence of $temp for identifying it (hopefully this is cheaper than checking the version with `uname -r`).