sh: guard cookie consistency across termination in the DMA driver