Generic vanishing in characteristic p > 0 and the characterization of ordinary abelian varieties