Bug # 403 http://bugs.skysql.com/show_bug.cgi?id=403
Comparing the return value of atomic_add instead of buffer's reference count variable.