x86: fixes some bugs about EFI memory map handling