loader.efi tries the partitions of the boot disk in turn. With another
UFS partition ahead of the root partition, as on NanoBSD images,
currdev was not updated to the intended partition and the loader
dropped to the prompt.
The partition's name is passed in devformat()'s buffer, which is
reused when the earlier partition is unmounted. Copy the name before
mounting, and set loaddev from currdev.