ContactsProvider: add synchronized to lookupAndCacheId

ContactProvider insert a new mimetype to database if it's
not found in db, but an error is observed that column
mimetype is not unique when inserting. It's assumed as a
concurrency error so make this method synchronized.

Change-Id: If33bfa7aed556996512667400308999ac0a1dc2d