Fixing warnings in utils/metadata when building under Windows/Cygwin

Builds under Cygwin and Linux with these changes
`GetLastError` returns a `DWORD` which is unsigned on Windows. Why cast to int here instead of changing the type specifier?