Lionel Messi has had his 21-month prison sentence for tax fraud lifted and exchanged for a €250,000 fine.