Magnetic proximity switch