new: Wrap adding and removing messages in atomic sections.