Clean up cursors in try/finally

Make sure we release cursor resources.

Change-Id: Ia122100b1350ae5db4804f8f0e95c49785ab645b
Deactivate the MiniThumbFile when it is not needed.

Issue description:
Unable to use camera after deleting all files in internal storage from PC
with MTP. The toast message "Connect USB storage before using the camera"
is poped up when we launch camera after deleting all files in internal storage
from PC with MTP.

Steps to reproduce the issue:
1. Launch Camera and take a picture.
2. Connect device to PC with MTP mode.
3. Delete all files on Internal stoage from PC.
4. Launch Camera after step 3 finished.
Then we find that we are unable to use camera and the toast message is poped
up.

Root cause:
The .thumbdata3--xxxxx in /sdcard/DCIM/.thumbnails/ is opened in
android.process.media process when we take picture in step 1. But the file is
never closed. So camera cannot create the directories(/sdcard/DCIM/Camera)
it needs to store captured pictures because "Device busy" error.

Solution:
Deactivate the MiniThumbFile when it is not needed.

Change-Id: I0faab5ffd95c5626f7f9ef1bc02b2ae56e2eb19b
Signed-off-by: hanpengx <pengfeix.han@intel.com>
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_packages_providers_MediaProvider into android-4.4