fifo: fixed bug in intermingle code where circular buffers wrap around