Add null check for CardDataImage on insert.

If a CardDataImage is inserted and CMHomeApiManager is notified, but the
row is then removed from the DB immediately or the ContentProvider
throws an exception, an NPE will occur. Check that CardDataImage is not
null when retrieving it from the DB immediately after insertion.

Change-Id: Ia3d7ffa03b11fe0a249ef60d79f88fc03bb369b8
Synchronize access to pending updates to Cards.

Ensure that modifications to pending updates to cards are not made while
iterating over the lists in CMHomeApiManager. Add synchronized blocks so
that multiple threads do not cause a ConcurrentModificationException.

Change-Id: I6279f7ef967c79cd571087017f00bc98bd47d3bd