Wrapped the read_one and rewind calls in a mutex. I'm not sure why that solved it, it might just be that it needed a couple extra clock cycles to finished the filepointer adjustment. Not sure. But there seems to be no more race condition