Electrodialytic recovery of carboxylic acid from wastewater