Planck pre-launch status: The HFI instrument, from specification to actual performance