Somaliland's leader of the opposition has won the breakaway region's presidency.