This should do the trick.
def loopy(dl):
    while True:
        for x in iter(dl): yield x

Then, everywhere you used to use iter(dataloader), use loopy(dataloader).
Beware though, that samplers passed to the DataLoader can raise StopIteration() exceptions.