fix infinite loop in the net api

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