Fix a Cursor leak

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

Change-Id: I44609478038ed3b5ea605eb9b3189fb28296a8e6