A classic Ferrari has become the most expensive car ever sold in Britain after it was bought for more than £24million.