Fix a Cursor leak

When cursor is done, the cursor must be closed to avoid cursor leak.

Change-Id: I05181f426e7c2f21722838b1297591f0cf556495