Charge-state control of ensemble of nitrogen vacancy centers by n–i–n diamond junctions