Define MAtomicAdd to return the previous value before the atomic addition.