md: ensure md devices are freed before module is unloaded.