Threshold kaon photo- and electroproduction in SU(3) baryon chiral perturbation theory