Saudi Arabia has abolished flogging as a form of punishment, the country's supreme court has announced.