Measurement of the WZ production cross section in pp collisions at sqrt(s)=7 and 8 TeV and search for anomalous triple gauge couplings at sqrt(s)=8TeV