fixes #8565 - only get unique, unused message/source IDs to speed up expiry

Indeed, we trip over a lot of bugs in Rails 3.2.8 in that area.