Merge "verify database state before calling sqlite. Bug:2593970" into froyo