Fix counter-based events and messages in message store cache

Three things are broken here:
 * We don't actually increment the event counter when adding an event to the cache.
 * We reconcile inbound messages before outbound, which may cause problems with new events arriving during recon. (Unconfirmed, but it's the only explanation I can think of.)
 * We increment counters whether we've seen a message before or not.