Change android fix for fts backward compatibility patch of sqlite3.c for newer sqlite version

From earlier version of Android, patch of FTS3 backwards compatibility is kept until now.
But, this patch doesn't work well on newer version of sqlite3 (3.7.13~) when it was used.
Currently, sqlite3Fts3Init function is called three times to register "fts1", "fts2" and "fts3" with the same module.
It worked very well on earlier version of sqlite but not for newer version.
hashDestroy() function makes an error when it is called after the first destroy of fts3Module.
sqlite3Fts3Init() function initializes "fts4" module and it is called three times to initialize "fts1" and "fts2".

This patch contains changed source code of sqlite3Fts3Init() function to be called once.

[written by Yongil Jang <yi.jang@lge.com>]

Change-Id: I55f522b55f421f73e83508cfc5e08514bd7da925
Fix bugs of sqlite that returns SIGBUS on disk full in WAL mode

Attempts to prepare a query on a WAL database when the disk space is
critically low result in the process killed with SIGBUS.
The crash happens in walIndexWriteHdr invoked from walIndexRecover.

Some Providers that using WAL mode like as SettingsProvider and MediaProvider
get failed in case of disk full with SIGBUS.
This patch changes unixShmMap() to call fallocate() instead of ftruncate.
In case of disk full, fallocate() will return SQLITE_FULL.

This patch is originated from www.sqlite.org.
(URL: http://www.sqlite.org/src/info/5eaa61ea18)
To simplify error status, returned error code is changed
from SQLITE_IOERR_SHMSIZE to SQLITE_FULL.

[written by Yongil Jang <yi.jang@lge.com>]

Change-Id: Idf3cbdab1ed4a4f2bc1b2b93ab6d8900edc7ee05
Fix bugs of database corruption following IO error on systems supporting atomic-write

SQLite on Android uses AUTO_VACUUM option.
When the disk space is critically low and atomic-write option is enabled,
SQLite writes transactions that modify a single database page on disk
without creating a journal file.

Due to a bug, if an IO or disk full error occurs while transferring
the contents to disk, the single page that was modified in the cache
is not being rolled back - cache corruption.
As a result, applications get a database corruption exception
for next database transactions.

This patch changes createFile() to close pReal in case of IO error.
Therefore, cache is being rolled back.

This patch is originated from www.sqlite.org.
(URL: http://www.sqlite.org/src/tktview?name=df678d738a)

Change-Id: Ieecda65d8458cb591bd4d89d8b423a4479f50ea8