TEMP path is set after it's already being used
TEMP path is set after it's already being used

Issue1:
Outcomes:
1. cleanup function tries to remove the directory which the environmental variable TEMP points to.
2. Any created temporary files by other utilities which auto_patcher is calling, are creating their files in the user's temp folder
This may cause permission denied issues.

Fix1:
Set TEMP before it being used.
Also set TMP and TMPDIR to the same target as TEMP so patch utility would also make its temporary files/dirs in the right place.

Issue2:
cygpath -ua "$1" returns a path with an ending /.
That would cause the result of commands like TOOL="$ROOT/patch_tools.tgz" to look like /cygdrive/d/somedir//patch_tools.tgz

Fix2:
Remove ending /

mateor/auto-patcher,mateor/auto-patcher,mateor/auto-patcher