credentials: only take into account persons with reference when looking up login from email

also simplify some error messages
relation field: fix error when displayed along with a matrixbox