Fix a Cursor leak

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

Change-Id: I8d837dd50473c3b14806f54ca8a78de14178b0cb