mm: vm: Fix bugs regarding segment linking

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>