Relaxation of the orientation of the potassium resonance levels due to collisions with rare-gas atoms