Measurement of the W+W- cross section in pp collisions at sqrt(s) = 8 TeV and limits on anomalous gauge couplings