Carbon-based membranes for membrane reactors