fix infinite loop

Warning: untested!
At turing/src/mionet.c:861, the tail doesn't wrap correctly, causing an infinite loop.