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
diff --git a/dist/sqlite3.c b/dist/sqlite3.c
index abe6186..8cdf8de 100644
--- a/dist/sqlite3.c
+++ b/dist/sqlite3.c
@@ -112400,7 +112400,7 @@
 extern "C" {
 #endif  /* __cplusplus */
 
-SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db, const char* registerAs); // Android Change
+SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db);
 
 #if 0
 }  /* extern "C" */
@@ -114730,24 +114730,9 @@
 #endif
 
 #ifdef SQLITE_ENABLE_FTS3
-  // Begin Android change
-  #ifdef SQLITE_ENABLE_FTS3_BACKWARDS
-    /* Also register as fts1 and fts2, for backwards compatability on
-    ** systems known to have never seen a pre-fts3 database.
-    */
     if( !db->mallocFailed && rc==SQLITE_OK ){
-      rc = sqlite3Fts3Init(db, "fts1");
+      rc = sqlite3Fts3Init(db);
     }
-
-    if( !db->mallocFailed && rc==SQLITE_OK ){
-      rc = sqlite3Fts3Init(db, "fts2");
-    }
-  #endif
-
-    if( !db->mallocFailed && rc==SQLITE_OK ){
-      rc = sqlite3Fts3Init(db, "fts3");
-    }
-  // End Android change
 #endif
 
 #ifdef SQLITE_ENABLE_ICU
@@ -120171,7 +120156,7 @@
 ** SQLite. If fts3 is built as a dynamically loadable extension, this
 ** function is called by the sqlite3_extension_init() entry point.
 */
-SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db, const char* registerAs){ // Android Change
+SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){
   int rc = SQLITE_OK;
   Fts3Hash *pHash = 0;
   const sqlite3_tokenizer_module *pSimple = 0;
@@ -120231,12 +120216,19 @@
    && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 2))
    && SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1))
   ){
+#ifdef SQLITE_ENABLE_FTS3_BACKWARDS
     rc = sqlite3_create_module_v2(
-        // Begin Android change
-        // Also register as fts1 and fts2
-        db, registerAs, &fts3Module, (void *)pHash, hashDestroy
-        // End Android change
-    );
+        db, "fts1", &fts3Module, (void *)pHash, 0
+        );
+    if(rc) return rc;
+    rc = sqlite3_create_module_v2(
+        db, "fts2", &fts3Module, (void *)pHash, 0
+        );
+    if(rc) return rc;
+#endif
+    rc = sqlite3_create_module_v2(
+        db, "fts3", &fts3Module, (void *)pHash, 0
+        );
     if( rc==SQLITE_OK ){
       rc = sqlite3_create_module_v2(
           db, "fts4", &fts3Module, (void *)pHash, 0