Search for W' decaying to tau lepton and neutrino in proton-proton collisions at sqrt(s) = 8 TeV