Now using __sync_fetch_and_add to atomically update next_seq_to_write