devices: add null check after map_guest_mem calls