Reliability of the interplanetary magnetic field polarities inferred from north-south cosmic ray anisotropy and geomagnetic data