Fix various build warnings

This fixes various build warnings on Mac and Windows (64-bit).

There are two noteworthy changes, I think.

1. I replaced a strcpy with a memcpy in `git_reference__alloc()` because the string length is known (which is why the strcpy was safe).
2. In `winhttp.c:put_uuid_string()` I replaced the call to `wsprintfW` with `StringCbPrintfW` which takes an extra parameter to ensure that the output buffer is not overrun. To be honest, I'm really not sure about this change, but there was a Windows deprecation warning for the old function and this is what MSDN recommended (and a sprintf that's not a snprintf always makes me nervous even though this was being checked beforehand).

I also removed some duplicated parameter validation code in `winhttp.c:get_temp_file()` and tried to clean up the associated code a bit.