Improve reliability of message_queue integration tests.

There is occasionally a small delay between rabbitmq accepting a
message, and that message being available on the queue.  Add a retry
mechanism to handle this case in the tests.