A former police detective has been jailed for 19 years for stealing cocaine from work to sell on the streets of Manchester.