Fix crash when the hook_spawn_failed hook is not set