Coding for a write-once memory