There is a known lack of atomicity in the apcu_incr and _decr functions as pointed out by @aaron at https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/524078/.
This patch proposes a workaround that basically uses polls using CAS and non-blocking tokens and retries that up to 10 times. While that workaround might be necessary in master either way to support third parties on older versions, it'd be nice if we could avoid this in production at least.