Fix getMimeTypeId/getPackageId

In the old code we only put ids to the cache in the insert case, but the
select case.  This means once the process restarts it'd never put anything in
the cache.

Also added the test for the conflict case.

Bug 16574964

Change-Id: I9979b61b6e1a3f04a81bcf2b78a678378f1a009c
2 files changed