Quantum error correction of a qubit encoded in grid states of an oscillator