(retroarch.c) refactor rarch_save_state/rarch_load_state