Before requerying a cursor, check if it is closed.

Before updating a cursor,
it needs to be checked if it is valid.
Currently a defence code only checks
if it is not null.
But in case of "Cursor", it is not valid,
if it is closed.
So just like in CursorAdapter.onContentChanged(),
add the additional defence code to check validation.

Change-Id: I1302f1b6d009897815d4bdb2f20f625688cf9901
FW: Menu & home unlock [1/2]

picked by hand from:
https://github.com/CyanogenMod/android_frameworks_base/commit/d446b052a89b0996fb5a9839b5210fda312b3c85

Change-Id: Iea248a579345eb552ed6f016b99107dc32499c58