mm: vm: Add thread safety to debugging code

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