compat-util: avoid macro redefinition warning

Some systems define fopen as a macro based on compiler settings, and
unconditionally redefining it triggers a compilation warning.
diff --git a/git-compat-util.h b/git-compat-util.h
index 167c3fe..01c4045 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -206,6 +206,9 @@
 #endif
 
 #ifdef FREAD_READS_DIRECTORIES
+#ifdef fopen
+#undef fopen
+#endif
 #define fopen(a,b) git_fopen(a,b)
 extern FILE *git_fopen(const char*, const char*);
 #endif