A characterization of toric varieties in characteristic $p$