efi: Fix a race and a buffer overflow while reading efivars via sysfs