ioservice: use work counter to improve performance