md: use generic io stats accounting functions to simplify io stat accounting