More tweaks to kpartx output parsing
Apparently kpartx likes to play with us, and different versions of
kpartx will give the mapped partition different names. Sometimes dashes
in the original name will be doubled, and sometimes a leading directory
in /dev (eg. a volume group name) will be included in the name itself.
In order to avoid that we just look in the output for anything which
includes the string '-1' (which is the first partition, with the
separator '-' which we forced kpartx to use with the -p- option).
Moreover, to be sure we don't pass on wrong information, we check that
our grep had some output, and that the created device actually exists
after running kpartx -a, with the output redirected to /dev/null as
otherwise sometimes it will echo a few lines which will be inserted in
the function result, and thus break the actual result filesystem_dev
variable.
Reviewed-by: iustinp