Method and device for securing the reading of a memory