Use fdatasync() to improve performance.

Linux has a working fdatasync() so we should use it!
This change alone improves performance by around 20% by reducing
the number of synchronous I/O writes of irrelevant metadata
changes.

Change-Id: Iebe0c32a7e018ec0ced2347b7d62b2b7dc5aa376
diff --git a/dist/Android.mk b/dist/Android.mk
index 3ea36c1..e380c9b 100644
--- a/dist/Android.mk
+++ b/dist/Android.mk
@@ -39,7 +39,7 @@
 LOCAL_LDLIBS += -lpthread -ldl
 endif
 
-LOCAL_CFLAGS += $(common_sqlite_flags) -DUSE_PREAD64
+LOCAL_CFLAGS += $(common_sqlite_flags) -DUSE_PREAD64 -Dfdatasync=fdatasync
 
 LOCAL_SHARED_LIBRARIES := libdl
 
diff --git a/dist/sqlite3.c b/dist/sqlite3.c
index fe17797..7f46e6e 100644
--- a/dist/sqlite3.c
+++ b/dist/sqlite3.c
@@ -25,10 +25,6 @@
 #ifndef SQLITE_API
 # define SQLITE_API
 #endif
-// Begin Android Add
-#define fdatasync fsync
-#undef __APPLE__
-// End Android Add
 /************** Begin file sqliteInt.h ***************************************/
 /*
 ** 2001 September 15