perf(messages): caches unread messages count to reduce queries