Restore NO Sync Patch for every row, only when finish adding.
SQLite: Enable fdatasync for SQLite

SQLite library recommends usage of fdatasync when available.
Since it is available for linux, enable it. This gives better
performance compared to fsync.

Change-Id: I47d5fb9cb1e8331729b54d77f10f7499e028269d
Merge tag 'android-4.4.3_r1.1' of https://android.googlesource.com/platform/external/sqlite into kk4.4

Android 4.4.3 release 1.1
Fix world-readable permissions due to sqlite race condition

Existing code uses umask() to temporarily modify the file permissions for
open(). A race condition can occur where a second thread reads in the
temporary value, saves it, and then restores the file to the temporary value
resulting in world-readable permissions. Backporting a known fix:
http://www.sqlite.org/src/info/6c4c2b7dba

Bug: 15288755
Change-Id: I89779f3a5ba0bec181d6614b29b1e26ea4f4f049