Ionic origin of a negative capacitance in lead halide perovskites