md: Fix a bug in linear.c causing which_dev() to return the wrong device.