Secondary positrons and electrons in near-Earth space in the PAMELA experiment