AppOps: add null pointer check for mms database cursor

If the database quering fail, there will be a null pointer issue
which leads to the whole sms backup process stopped.

Change-Id: I49eecb7050b0673e1c64bfc5e1668404b73e3d3b