Guard against attempting to close and already closed cursor.