Switch std::stringstream to std::ostringstream when we aren't using its
std::istream-ness. (This turns out to be nearly everywhere.) Switch
std::stringstream to std::istringstream in the one place where we are
using only its std::istream-ness.