Production of charged pions at high transverse momentum in pp collisions at √s=45 and 62 GeV