Measurements of positronium formation cross sections for positron-ar and-K scattering