First of all, there is no point in creating your DAQmx task just to get 1 sample and then kill it. Do the DAQmx setup and the task start before your loop. Stop and clear the task after the loop. You can the read inside the loop all day long (use the 1 Channel N Samples setup though to get all of your data).
I highly recommend you get rid of the Write To Measurement File Express VI. I think that is keeping your file open and therefore not allowing you to delete it. Instead, learn to use the TDMS File VIs. Instead of keeping your path in the shift register, keep the file reference. When it is time to delete the file, you can close it and you will be given the path of the file you just closed. Deletion is simple from there.
What I would probably do in this situation is keep a buffer of the data and only save the waveforms when desired, instead of saving and deleting. It'll be a lot easier on your harddrive.