backend: mark the thread as finishing, when we are out of the IO loop