Measurement of ZZ production in pp collisions at $\sqrt{s}=7$ TeV and limits on anomalous ZZZ and ZZγ couplings with the ATLAS detector