Search for physics beyond the standard model in dilepton mass spectra in proton-proton collisions at sqrt(s) = 8 TeV