md: fix use-after-free bug when dropping an rdev from an md array