p-torsion of curves in characteristic p