md: Be more careful about clearing flags bit in ->recovery