Active compensation of extrinsic polarization errors using adaptive optics