backend: only terminate multiple loops if we did no IO