Water softening in a crossflow membrane reactor