Carbon-based materials for desalination and energy harvesting from salinity gradients