menu_animation: Fix a guard against realloc