Respect HOMEDRIVE environment variable if set

HOMEPATH variable only contains the part of the path after the drive
letter, so using it directly will result in wrong behavior if the
script is run from a different drive. Joining this path to the HOMEDRIVE
variable yields the correct path.

Use os.environ.get instead of directly indexing into the dictionary to
make sure we maintain backwards compatibility with systems where
HOMEPATH may have been supplied manually, without HOMEDRIVE.

Change-Id: Ifc94af807433ba628cee4ac6ac9cd9e7abebe80b
diff --git a/git-cookie-authdaemon b/git-cookie-authdaemon
index a4e7cac..d4fc036 100755
--- a/git-cookie-authdaemon
+++ b/git-cookie-authdaemon
@@ -84,7 +84,7 @@
     # Set cookie file as %HOMEPATH%/.git-credential-cache/cookie,
     # so it can be used in both cases.
     if 'HOMEPATH' in os.environ:
-      homepath = os.environ['HOMEPATH']
+      homepath = os.path.join(os.environ.get('HOMEDRIVE'), os.environ['HOMEPATH'])
     else:
       # When launched as a scheduled task at machine startup
       # HOMEPATH may not be set.