[libretro] Fix possible std::out_of_range exception