blockdev-util: fix access to possibly invalidated dirent struct
Let's copy out the string we need from the dirent, there's no reason to
believe the dirent struct might live for longer than one loop iteration.
(cherry picked from commit c68fc351)
(cherry picked from commit 928ab001)