Stocks end December, year sharply lower, despite day's gains