This change fixes two checks that conflated memory mapping and memory
segment idenitifers. In both cases the code iterates over all memory
mappings but passes the index to vm_memseg_sysmem, which is wrong.
Fix this by passing the memory mapping's segment identifier instead.
Fixes: c76c2a19ae37