Lee,
That's quite a dilemna! If you cancel your insurance policy before the 12 months period, you won't get the no claims bonus for that period, even if you've just got 2 months left. It's either you complete the 1 year or nothing. If you sell your car and leave the insurance in your name, you will be liable for any claims arising from that vehicle.
So if you really wanted to get the
no claims discount, you should really sell after 2 months. By wanting to protect your no claims, you are also running the risks that if the person who is buying your car has an accident after you've sold it, you will lose your no claims discount and will have to pay for damages.
Sell your car first, then cancel your insurance.