A Boston man who spent 38 years in prison in the killing of a cab driver has been released after a prosecutor agreed to vacate his conviction because significant doubt had been raised about the fairness of his trial.