fix detection of strange (xxxNpM) structures when finding the device for a partition [Closes: issue1244]