Rainbow triangles and the Erdős-Hajnal problem in projective geometries