As retirement nears, shifting some money from stocks to bonds can reduce risk without sacrificing stability.