Entanglement production by quantum error correction in the presence of correlated environment