Open-system quantum error correction