Fix error throwing by calling getCount before closing the cursor.

Test: no need
Bug: 320419200
Change-Id: I6c894080bf476fb21773e2a44ef1f67ca37e4347
(cherry picked from commit ab53ed39d4138298cabb093aaae69e68f24c5762)
1 file changed