Spin-lattice coupling in iron-pnictide superconductors