Measurement of prompt psi(2S) production cross sections in proton-lead and proton-proton collisions at root s(NN)=5.02 TeV