safely exit (shutdown dma on signal)