fix finding cookie file on windows

On some Windows systems the right way to retrieve the user's home directory
is by using the HOMEDRIVE and HOMEPATH environment variables. If these are
defined, they will be used in preference over "user.home"