Nanoporous carbon membrane for gas separation