md: avoid deadlock when dirty buffers during md_stop.