Cellular-automaton decoders for topological quantum memories