Depletion of chlorine into HCl ice in a protostellar core. The CHESS spectral survey of OMC-2 FIR 4