Fix building with MinGW
Make default User-agent follow RFC 2616