First the Linuxcnc version you quote is invalid. What is it really?
Second, 256 is a very signiicant number for computers because an 8 bit number (1 byte) counts from 0-255 which a computer's way of counting from 1-256.
The G54 values are stored in the var file. I could not see exactly what us the varibale number on a quick look. I would check this after you close to make sure its not being incremented on close,
My guess is that Linuxcnc will be OK but somehow outside of LinuxCNC, your encoder value is incremented by 1 X 8 bit byte.