OF-3301: Prevent concurrency issue when checking Offline Message Store cache
Replace the unsafe containsKey() / get() check with a single atomic read that treats null values as a cache miss. The same pattern was present in addMessage() and has also been corrected.
(cherry picked from commit 9888ada5f6d5e2d69d1554220e9b64004f62c8e9)