US stocks close at record high as final month of 2024 begins