[PATCH v2 1/7] efi_loader: Refactor device and image paths into a function