vm: fix crash on fatal error in debug context