Actor Bill Cosby has secured a buyer for his $29 million New York City townhouse—months after it was revealed he had gone into foreclosure on both of his Manhattan homes.