First-principles molecular dynamics study of the stretching frequencies of hydrogen molecules in carbon nanotubes