The dataset dset and all SAMPLE structures attached to it are freed,
including input and output vectors and the set's input and output descriptions.
First, a check is performed to see whether the function has write access
(see DATASET-ACCESS-flags). If so, the linked list of samples is traversed
and all members are deleted. Samples are deleted using the free_sample
function. Finally, the dataset itself is freed with a call to free_dataset.