Storage and transmission of entanglement in a spin chain