fixed some queue bugs when ReadMessageIndex fell behind

There were bugs with detecting when it needed to do something special
and what it did about it.

This includes adding an assert to catch when it tries reading from a
freed message rather than failing when somebody attempts to double-free
it later and a test for doing it wrong.

This was what made running log_streamer and binary_log_writer at
the same time fail.
3 files changed