efi_loader: refactor efi_open_protocol