libgd: fixes for msys compilation