x86: EFI: fix use of unitialized variable and the cache logic