Mutually exclude getting messages from adding messages.
Properly synchronize getAllMessages() to prevent problems with
disappearing Message IDs.
Minor improvements for the LimitedMessageStoreTest.