Double Olympic champion Mo Farah came through a tough test to win the 5000 metres at the Diamond League