Refactor general_write_handler - reduce calls to rarch_main_command