Don't run tasks with already closed connections.