Relationship between Kerr effect and perpendicular magnetic anisotropy in Co1−xPtx and Co1−xPdx alloys