Riot erupts after funeral for man hurt in police custody