avutil/atomic: reuse ret to avoid dereferencing twice the same value.