Python Atomic Operations In C