Automated system for measuring polarization-dependent loss