Avoid dereferencing end iterators.

I think it was dereferencing them because reverse iterators don't work with
BOOST_TEST_EQ, instead use the underlying iterator which works with it.