Impact of lattice dynamics on the phase stability of metamagnetic FeRh: Bulk and thin films