The pay-TV group BSkyB has given up its court fight over ITV and has cut its stake to meet competition rules.