Avoid expression tree depth error in removeUnferencedAddresses()

With more than 1000 referenced canonical addresses, the expression
tree will be too deep for the default sqlite setting of 1000. This
causes the delete to fail, bringing with it the whole transaction.
It looks something like this:

E SQLiteLog: (1) Expression tree is too large (maximum depth 1000)
E MmsSmsDatabaseHelper: Expression tree is too large (maximum depth
    1000) (code 1): , while compiling: DELETE FROM canonical_addresses
    WHERE _id != 1158 AND _id != 1650 AND _id != 1459 AND _id != 1021
    AND _id != 1701 AND _id != 1973 AND _id != 1124 AND _id != 1720
    AND _id != 1494 AND _id != 1282 AND _id != 1042 AND _id != 1312
    AND _id != 1781 AND _id != 1525 AND _id != 1262 AND _id != 1265
    AND so on...

Using NOT IN avoids the depth problem (and is marginally prettier).

Change-Id: I8d39a3ee7ad30948d0179adb75d579e01a0eb749
1 file changed