Make rarch_main_clear_state more resilient