In an emotional address President Obama has paid tribute to the five policemen killed by a sniper during a protest against police violence in Dallas last week.