Cursor leakage due to cancellation signal

If a query call was cancelled, the cursor adaptor might leak. The
adaptor is now closed if any exception is thrown during query.

Change-Id: Ic4c2edeaf2fcef56b4ef59484a36d3233aa12dbc
Fix fatal exception due to missing looper for current thread.

While creating handler for the thread, there was fatal exception getting
thrown because the present thread does not have a looper. So passing the
applications looper to be used , while creating the handler to avoid this
exception.

Change-Id: Id2e3ed61f5691c8319eb7bc20ad970eb6758e765
(cherry picked from commit f5d1769b4357fb8d86fc31f7115b55b567a20ed1)
(cherry picked from commit d0a7c5833b90fe4d8fe8f968b53a7028720ffd8c)
Fix a JNI local reference leak in MediaDrm

A reference leak was found in the subtitle usecase that also
applies to android_media_MediaDrm.cpp
(Code taken from the similar fix in android_media_MediaPlayer.cpp)

Change-Id: Icc4b25e4adc9a600ff4ac99a7a8478bb55a6e348