md_monitor: Terminate strings after reading from sysfs

Although we cannot read unterminated strings from sysfs we might
be reading strings which are larger than the buffer. So add
proper checking here to avoid silent buffer overflow.
Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: use MD name in lookup_md_alias()

When looking up a MD array it might be specified by either the
actual device node name or the MD array name, so we need to
check for both.

References: bnc#876830

Signed-off-by: Hannes Reinecke <hare@suse.de>
Version 5.1

Signed-off-by: Hannes Reinecke <hare@suse.de>