Water ice deuteration: a tracer of the chemical history of protostars