"isMediaDatabaseName" API has to return true only if a parameter is database file path.

But it check only prefix with 'external-'.
Media provider uses Write Ahead Logging that makes wal and shm files.
In case of wal and shm files, the API can also return true.
So additionally, the API has to confirm that the file path has '.db' extension.

Signed-off-by : kwangjung kim <kwangjung.kim@lge.com>

Change-Id: Ibc394ab5dac169b126bce58d9416d2196b1afe61
Fix logic that delete "-wal" file.

"databaseList()" method, All files in database folder are returned.
Such as "-wal" file, "-shm" file and so on.

In case of media provider, it uses WAL mode.
If "-wal" file is deleted, side effects appear to SQLITE_IOERR_SHORT_READ and user data is deleted.
Therefore, When deleting a database file, ".db" extension should be checked.

Signed-off-by : kwangjung kim <kwangjung.kim@lge.com>

Change-Id: Ie833d3990f1988929665d4c1b2ea77ad92bd2ded
Simplify DB query with "COLLATE nocase" instead of "LIKE" and "substr"

Nocase comparation with "LIKE" and "substr" DB query can be changed to
"COLLATE nocase" on SQLite.

Change-Id: I66e4e22758d1cf8fbb3e3e3eb3920576eb61d93d