md: Better control of when do_md_stop is allowed to stop the array.