Avoid deadlock whith iothread and icount