Sri Lanka has signed a controversial $1.1bn deal, which gives China a majority share in running one of its ports.