People are more likely to blame violent video games for school shootings when perpetrators are white than when they are black, a study suggests.