Theory of voltammetry in charged porous media