Close cursors

Close SQL cursors to avoid leaking them
import not needed?