South Africa's Richard Murray has claimed his first ITU World Triathlon Series victory after a furiously fast race in Hamburg.