Close to half of Democrats — 44% — are optimistic about the future, up from 27% in July; just 9% of Republicans are optimistic about nation’s direction