Fix __sync_add_and_fetch calls
No more segfault due to atomic add