On a theorem of Wielandt for finite primitive permutation groups