Hydrothermal treatment of pharmaceutical wastewater