A robot malfunction at a festival in China has raised concerns about AI safety after it seemingly attacked attendees.