Bug fix: CDataStream::GetAndClear() when nReadPos > 0

Changed CDataStream::GetAndClear() to use the most obvious
get get and clear instead of a tricky swap().

Added a unit test for CDataStream insert/erase/GetAndClear.

Note: GetAndClear() is not performance critical, it is used only
by the send-a-message-to-the-network code. Bug was not noticed
before now because the send-a-message code never erased from the
stream.
-fuzzmessagestest=N : randomly corrupt 1-of-N sent messages

I needed this to test the new "reject" p2p message, but it should be generally
useful for fuzz-testing network message handling code.
Merge pull request #3173 from gavinandresen/fuzzmessages

-fuzzmessagestest=N : randomly corrupt 1-of-N sent messages