Rename chewing.db to chewing.sqlite3

The db extension name [1] is used by other program, so we just change to
use sqlite3 extension name [2].

[1] http://www.fileinfo.com/extension/db
[2] http://www.fileinfo.com/extension/sqlite3
Add \n in LOG_XXX macros
Do phoneSeq length check before SQL operation