Performance of CMS hadron calorimeter timing and synchronization using test beam, cosmic ray, and LHC beam data