Using `call-as-atomic' isn't right, because that allows an escape via `call-as-nonatomic'. Assuming that `call-as-nonatomic' isn't used, it seems like `call-as-atomic' should be ok, anyway, but somehow its leads to unbalanced `end-atomic' calls.
ffi/unsafe/nsalloc' and